+ 2

What is recursion in Java ?

2nd Feb 2018, 1:45 AM
Parag Jain
Parag Jain - avatar
2 Answers
+ 16
//method is called again and again , from the itself u can get the meaning example ::: recursion for calculating factorial fact (n){return n==1?1:n*fact(--n);} //it will call fact () again & again , until n becomes 1
2nd Feb 2018, 8:26 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
2nd Feb 2018, 2:08 AM
Hatsy Rei
Hatsy Rei - avatar