// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;

public class Age {
   public static void main(String[] args) {
      System.out.println(age(1993, Calendar.DECEMBER, 2));
      System.out.println(age(1993, Calendar.DECEMBER, 3));
      System.out.println(age(1993, Calendar.DECEMBER, 4));
   }
   private static int age(int y, int m, int d) {
      Calendar cal = new GregorianCalendar(y, m, d);
      Calendar now = new GregorianCalendar();
      int res = now.get(Calendar.YEAR) - cal.get(Calendar.YEAR);
      if((cal.get(Calendar.MONTH) > now.get(Calendar.MONTH)) ||
         (cal.get(Calendar.MONTH) == now.get(Calendar.MONTH) &&
         cal.get(Calendar.DAY_OF_MONTH) > now.get(Calendar.DAY_OF_MONTH))) {
         res--;
      }
      return res;
   }
}
