F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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 个错误


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 21:06:58, Gzip enabled