Constructor call must be the first statement in a constructor

来源:互联网 发布:手机打开php文件 编辑:程序博客网 时间:2024/05/16 06:05

Constructor call must be the first statement in a constructor

package thinkinjava;public class Assignment { String name ;Assignment(){System.out.println("bob");this("k");}Assignment(String name){System.out.println(name);}public static void main(String[] args) {// TODO Auto-generated method stub new Assignment();}}
调用必须在第一行。

0 0