+ 2
What is the Recursive Function ? And how can i use it ?
3 Answers
+ 19
A function which calls itself is called a recursive function.
For example:
int factorial(int n) {
if (n == 1)
return 1;
else
return n * factorial(n - 1); // recursion
}
+ 3
I think a function is recursive when it calls itself.
I can't give you a good example as I rarely use java but you can look for other discussions (or codes) regarding this topic. Just search for recursion :p
+ 3
this thread feels self referential...