January 2015 | VirtualSpecies

Java Recursion Method

This is one of my favorite part of java programming. It is little bit complex with its function. And obviously, it will turn to be a fun part, if you get it. It is called Java Recursion.
So what is Java Recursion?

Recursion is a programming technique where a method calls itself to find result. You need to follow these steps to work with Recursion successfully_
    _You need to figure out a stopping point which can be resolve without calling recursive function.
    _With calling every recursive method, you must reduce or approach to the stopping point otherwise you will get java.lang.StackOverFlowError(Learn more about StackOverFlowError)
Let’s consider the following recursive code: