Skip to content

Instantly share code, notes, and snippets.

@sapanparikh18
Created March 21, 2018 10:07
Show Gist options
  • Save sapanparikh18/42a914dd54edc262f29144b253925059 to your computer and use it in GitHub Desktop.
Save sapanparikh18/42a914dd54edc262f29144b253925059 to your computer and use it in GitHub Desktop.
// 1.
int years = getYears(getDateOfBirth());
int months = getMonths(getDateOfBirth());
System.out.println("The age of the person is" + years + "years and "+months+" months");
// 2.
Date dob = getDateOfBirth();
int years = getYears(dob);
int months = getMonths(dob);
System.out.println("The age of the person is" + years + "years and "+months+" months");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment