2016-03-10 41 views
-3
public class DateThreeT { 

    public static void main(String [] args) { 
     DateThree dateobj = new DateThree(); 
     dateObj.setDay(03); 
     dateObj.setMonth(19); 
     dateObj.setYear(2016); 

     System.out.println(The date is:" + dateobj.getDay() + "\" + 
          dateobj.getMonth() "\" + dateobj.getYear()); 

    } 
} 
+1

你错过了一个'+'。 – Mena

+1

还有一个''''。 – Eran

+0

dateobj.getMonth()“\”应该是dateobj.getMonth()+“\” –

回答

0

你错过“之前的日期和+后得到月()

System.out.println("The date is:" + dateobj.getDay() + "\" + 
          dateobj.getMonth()+ "\" + dateobj.getYear()); 
+0

非常感谢,尽管我已经纠正了这些问题 – babs115

1

有很多错误(如选项dateObj和选项dateObj不相同)和我有固定所有的人如下所示

public class Assignment1 { 
    public static void main(String [] args) { 
     DateThree dateObj = new DateThree(); 
     dateObj.setDay(03); 
     dateObj.setMonth(19); 
     dateObj.setYear(2016); 
     System.out.println("The date is:" + dateObj.getDay() + "\\" + dateObj.getMonth() + "\\" + dateObj.getYear()); 
    } 
} 
相关问题