+ 2
How to make recursive program in Java?
2 Réponses
+ 4
Simply make a function that calls itself.
Public int iterateToTen(int i) {
If (i=10){
return i;
} else if(i<10) {
i=i+1;
return interateToTen(i) ;
} else {
i=i-1;
return interateToTen(i) ;
}
}
0
I understand a little more, but…
Can you give me more example about recursive program in Java?