静态方法内部,通过对象引用去调用非静态方法
public class Test {
private int a;
public int getnumber() {
setnumber(8);
return this.a;
}
public int setnumber(int a) {
return this.a = a;
}
public static void main(String args[]) {
Test t = new Test();
// t.setnumber(10);
int a = t.getnumber();
System.out.println(a);
}
}