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