Types of recursions in Java