大家看看为什么我的方法调用错误
class Persons {int id;
int age;
public Persons (int i, int a) {
id = i;
age = a;
}
public int getId () {
return id;
}
public int getAge () {
return age;
}
public int reworkId (int i) {
id = i;
return id;
}
public int reworkAge (int i) {
age = i;
return age;
}
public void display() {
System.out.println ("ID:" + id + "Age:" + age);
}
}
public class Fanhui {
public static void main(String args[]) {
Persons a = new Persons(1,13);
a.dispaly ();
System.out.println("ID:" + a.getId);
System.out.println("Age:" + a.getAge);
System.out.println("ID:" + a.rework(2));
System.out.println("Age:" + a.rework(15));
}
}
谁能帮我检查一下方法调用出了什么问题。
[ 本帖最后由 vecomwa 于 2009-9-16 17:33 编辑 ]