0_0_29437665_24275\Main.java:1: 错误: 需要class, interface或enum
public static Date getnewDate(Date olddate, String recordDate) throws ParseException { Date date = olddate; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String data = format.format(date); String dataStr[] = data.split("-"); //年份 int year = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))/12; //月份 int yue = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))%12; String a = ""; if(yue<10){ if(yue<1){ a = "12"; }else{ a = "0"+yue; } }else { a = yue+""; } dataStr[0]=String.valueOf(Integer.parseInt(dataStr[0]) + year); dataStr[1]=a; String newdata = dataStr[0]+"-"+dataStr[1]+"-"+dataStr[2]; Date newDate = format.parse(newdata); return newDate; }
^
0_0_29437665_24275\Main.java:1: 错误: 需要class, interface或enum
public static Date getnewDate(Date olddate, String recordDate) throws ParseException { Date date = olddate; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String data = format.format(date); String dataStr[] = data.split("-"); //年份 int year = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))/12; //月份 int yue = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))%12; String a = ""; if(yue<10){ if(yue<1){ a = "12"; }else{ a = "0"+yue; } }else { a = yue+""; } dataStr[0]=String.valueOf(Integer.parseInt(dataStr[0]) + year); dataStr[1]=a; String newdata = dataStr[0]+"-"+dataStr[1]+"-"+dataStr[2]; Date newDate = format.parse(newdata); return newDate; }
^
0_0_29437665_24275\Main.java:1: 错误: 需要class, interface或enum
public static Date getnewDate(Date olddate, String recordDate) throws ParseException { Date date = olddate; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String data = format.format(date); String dataStr[] = data.split("-"); //年份 int year = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))/12; //月份 int yue = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))%12; String a = ""; if(yue<10){ if(yue<1){ a = "12"; }else{ a = "0"+yue; } }else { a = yue+""; } dataStr[0]=String.valueOf(Integer.parseInt(dataStr[0]) + year); dataStr[1]=a; String newdata = dataStr[0]+"-"+dataStr[1]+"-"+dataStr[2]; Date newDate = format.parse(newdata); return newDate; }
^
0_0_29437665_24275\Main.java:1: 错误: 需要class, interface或enum
public static Date getnewDate(Date olddate, String recordDate) throws ParseException { Date date = olddate; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String data = format.format(date); String dataStr[] = data.split("-"); //年份 int year = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))/12; //月份 int yue = (Integer.parseInt(dataStr[1]) + Integer.parseInt(recordDate))%12; String a = ""; if(yue<10){ if(yue<1){ a = "12"; }else{ a = "0"+yue; } }else { a = yue+""; } dataStr[0]=String.valueOf(Integer.parseInt(dataStr[0]) + year); dataStr[1]=a; String newdata = dataStr[0]+"-"+dataStr[1]+"-"+dataStr[2]; Date newDate = format.parse(newdata); return newDate; }
^
4 个错误
|