Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. package grundlagen;
  2.  
  3. public class rekursion {
  4.  
  5. public static void main(String[] args) {
  6. // TODO Auto-generated method stub
  7.  
  8. rekursiv(1);
  9. }
  10.  
  11. public static void rekursiv(int x) {
  12. System.out.println("Methodenaufruf " + x);
  13. x++;
  14. if (x < 4) {
  15. rekursiv(x);
  16. }
  17.  
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement