0
我在主程序中出现错误,任何人都可以帮我找到错误在哪里?我试图创建一个类,使用的setter /吸气设定每个字段,其中最终我会测试这个类它,以确保下地干活找不到错误
public class College{
public class person{
private String name;
private int age;
private double id;
//constructor to set fields
public Schedule (String name, int age, double id){
this.name= name;
this.age= age;
this.id= id;
}
public String getName(){
return this.name;
}
public void setName(String Name) {
this.name= name;
}
public int getAge(){
return this.Age;
}
public void setAge(int age) {
this.age = age;
}
public double getId(){
return this.id;
}
public void setId(double id) {
this.id = id;
}
}
public static void main(String[] args) {
Schedule Per1= new College("John", 2,2.0);
}
}
你需要显示从主代码,你尝试实例/操纵类。 – Tim 2014-10-02 02:38:10