public static int getAgeByBirth(Date birthDay) throws ParseException {int age = 0;Calendar cal = Calendar.getInstance();if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算throw new IllegalArgumentException(
从键盘输入一个年份,程序输出改年出生的人的生肖。 import java.util.Scanner; public class Sesx { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(“请输入你的出生年份”); int year = sc.nex