class Person(){
public void Test(){
System.out.print("xxxx");
}
}
class A(){
private Person p;
public A(Person p){
this.p=p;
p.Test();
}
}
为什么p可以直接调用Test方法?讲的越详细越好,谢谢大神!!!
public void Test(){
System.out.print("xxxx");
}
}
class A(){
private Person p;
public A(Person p){
this.p=p;
p.Test();
}
}
为什么p可以直接调用Test方法?讲的越详细越好,谢谢大神!!!