/**
* RecursionExample demonstrates nested recursion.
*
* @author ( TK Rogers )
* @version ( 10-16-13 )
*/
public class RecursionExample {
public static void main ( ) {
System.out.println ( "final answer = " + recur ( 27 ) ) ;
}
public static int recur ( int n ) {System.out.println ( "n = " + n ) ;
if ( n <= 10 ) {}System.out.println ( n*2 ) ;
return n*2 ;System.out.println( "2*n = " + n ) ;
return recur ( recur ( n/3 ) ) ;}
}