String[] birth = 生日.split("年"); Integer year = Calendar.getInstance().get(Calendar.YEAR);
//得出年龄 Integer age = year-Integer.parseInt(birth[0]);
String[] birth = 生日.split("年"); Integer year = Calendar.getInstance().get(Calendar.YEAR);
//得出年龄 Integer age = year-Integer.parseInt(birth[0]);
转载于:https://www.cnblogs.com/hsj666/p/7068529.html