MenuTest这个类存在不?是不是有这么一个java文件呢?你的写法没错,只是不规范而已.java要求类名首字母最好是大写的.具体写法没错,构造函数不能呗称作调用,构造函数是重载....
不能,顶多是子类在构造方法内调用父类的构造方法,构造方法一般都是在实例化一个对象时,被自动调用,
不能,顶多是子类在构造方法内调用父类的构造方法,构造方法一般都是在实例化一个对象时,被自动调用
MenuTest类新建一个以MenuTest.java命名的java文件,或者删除之后把main函数直接放在testnote类下面。
可以
public class PlanNum250 {
private String planNumber;
private String type;
private String type2;
private String type3;
public PlanNum250() {
}
public PlanNum250(String planNumber) {
this();
this.planNumber = planNumber;
}
public PlanNum250(String planNumber, String type) {
this(planNumber);
this.type = type;
}
public PlanNum250(String planNumber, String type, String type2) {
this(planNumber, type);
this.type2 = type2;
}
public PlanNum250(String planNumber, String type, String type2, String type3) {
this(planNumber, type, type3);
this.type3 = type3;
}
}