+ 2

What is the Recursive Function ? And how can i use it ?

20th Nov 2017, 11:08 AM
Nadin
Nadin - avatar
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 }
20th Nov 2017, 12:56 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 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
20th Nov 2017, 12:57 PM
Nick
Nick - avatar
+ 3
this thread feels self referential...
21st Nov 2017, 10:25 AM
Craig Brownell
Craig Brownell - avatar