+ 5
Methods from Methods
In Python you can make a function that can call other functions, can you do the same thing woth methods in Java.
8 Antworten
+ 13
Yes but you can do anything.... This is just an example....
+ 20
public int method2() {
return 1;
}
public int method1() {
return method2();
}
+ 14
Yes.
+ 1
ValentinHacker what is the syntax for it in Java please
+ 1
so does that just use the return type of the other method
- 1
Absolutely, and it can also call itself:
public void print_n_times(n):
System.out.println("hi")
print_n_times(n - 1)
- 2
Can't answer