Let\'s say I have this:
PrintStream out = System.out; Scanner in = new Scanner(System.in); out.print(\"Enter a number ... \"); int n = in.nextInt();
Try java.util.Calendar type.
java.util.Calendar
Calendar cal=Calendar.getInstance(); cal.setTime(yourDate.getTime()); cal.set(Calendar.YEAR,n);