class Person {
public void eat (Apple apple){
Apple peeled = apple.getPeeled();
System.out.println("Yummy");
}
}
class Peeler{
static Apple peel(Apple apple){
return apple;
}
}
class Apple {
Apple getPeeled(){return peeler.peel(this)}
}
public class PassingThis{
public static void main(String[] args){
new Person().eat(new Apple());
}
}
以上的程序怎么分析,麻烦大神说一下详细分析过程,解释一下结果为什么? |
|