Java Tutorial

What is Java


Control Statements


Java Object Class


Java Inheritance


Java Polymorphism


Java Abstraction


Java Encapsulation


Java Array

Java OOPs Misc


Recursion in Java

Recursion in java is a process in which a method calls itself continuously. A method in java that calls itself is called recursive method.

It makes the code compact but complex to understand.

Syntax:

Flash Soon


Java Recursion Example 1: Infinite times

Flash Soon


Output:

Java Recursion Example 2: Finite times

Flash Soon


Output:

Java Recursion Example 3: Factorial Number

Flash Soon


Output:

Java Recursion Example 4: Fibonacci Series

Flash Soon


Output:

Copyright ©2017 Design& development