new Date("2002/10/1")是不推荐使用的方法。

解决方案 »

  1.   

    Date
    public Date(String s)Deprecated. As of JDK version 1.1, replaced by DateFormat.parse(String s). Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the parse(java.lang.String) method. Parameters:
    s - a string representation of the date.
    See Also:
    DateFormat, parse(java.lang.String)
      

  2.   

    Calendar MyDate = Calendar.getInstance();
    MyDate.setTime(new java.util.Date());