构建器的名字和类一样,在产生实例的同时设置某些属性或者执行构件器内的任务,比如初始化,构建器允许重载,还有就是不能被声明为native ,static synchronsized,final and abstract

解决方案 »

  1.   

    上两位说的都不错,我就是说一下,一般,Java中一定会调用父类的构造器的。
    或着自己写或则系统自动。如果用super记得一定在第一行。
      

  2.   

    The method name must exactly match the classname.
        There must not be a return type declared for the method.
        The Default Constructor
           • Is in every class
           • Enables you to create object instances with new Xxx()
           • Is invalid if you add a constructor declaration with arguments