close

public class Forest {
public static void main(String[] args){
DateFormat df = new DateFormat() {

@Override
public java.util.Date parse(String source, ParsePosition pos) {
// TODO Auto-generated method stub
return null;
}

@Override
public StringBuffer format(java.util.Date date, StringBuffer toAppendTo,
FieldPosition fieldPosition) {
// TODO Auto-generated method stub
return null;
}
};
Date date=new Date();
df.setLocale(Local.Ialy);
}
}

 

---------------------------------------------

編譯錯誤

首先 Date date = new Date(); 

沒有new Date()這個東西,只有Date(long date)與Date(int year,int month, int day)

再來df沒有setLocale()方法,也沒有Local類別而是Locale。而靜態屬性中也沒有Ialy只有ITALY。

這題很多錯誤存在。

arrow
arrow
    全站熱搜

    pcwiki 發表在 痞客邦 留言(0) 人氣()