recursive methods LINK
 

import java.io.*;
import java.util.*;//to use EnumSet, EnumMap classes
public class Test_This {

/**
* @param args
*/
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String str ="";
Process pp = new Process();

try{
System.out.print("Please Enter an integer: ");
str = br.readLine();
int n= Integer.parseInt(str);
System.out.println("go to externl class ");
System.out.println("\ttotal "+ pp.read_recursive(n));
System.out.println("back to main");

}//try
catch(NumberFormatException e)
{ System.out.println("data was blank");}
}
}
class Process
{
private static int counter = 1;
public Process(){ System.out.println("Parent class Process constructor responded " + counter++);}
public int x = 0;
public int read_recursive(int n1)
{
if (n1 == 1)
{ x++;
System.out.println("\tn1==1 " + x);
System.out.println("\t-------- ");
return 1;
}
else
{
x++;
System.out.println("\telse " + x);
return (n1 + read_recursive(n1 - 1));
}
}
}