import java.io.*; import java.text.*; public class rfunction { static final int YEAR=2001; public static int year_of_birth(int age) { return YEAR-age; } public static void main(String []args) throws IOException { int age; //user's age int yob; //year of birth System.out.print("Please enter your age this year: "); BufferedReader in = new BufferedReader (new InputStreamReader(System.in)); //need this to read from the keyboard age=Integer.parseInt(in.readLine()); //take what user types and translate it into an int yob=year_of_birth(age);//function "call" System.out.println("You were born in: "+yob); } }