因为你没有引入java.util.Date
你只引入了java.sql.Date,那么当然它用这个Date方法了
据我所知,java默认引入的包好象是java.lang.*,不知道有没记错,谢谢。

解决方案 »

  1.   

    java.lang.Object
      |
      +--java.util.Date
            |
            +--java.sql.Date所以import java.lang.*;就可以了。
      

  2.   

    应该引入util
    即:import java.util.*;
      

  3.   

    Class B extends Class A.
    Class C extends Class B.
    Then, if in Class B, there exists any Constructor, The Constructors in Class A is no longer available to Class C.
    A lot of people never notice that, but that's exactly your problem. However, if you don't have any particular reason, it's not recommended to use java.sql.Date.
    Use java.util.Date or java.util.Calendar.