日期:2014-05-20  浏览次数:20638 次

this的疑惑
public       class       UpDown2       extends       Applet       implements       Runnable{      
    static       int       RADIUS=20;      
    static       int       x=30;      
    public       int       y=30;      
    Thread       t;      
    public       void       init(){      
    t=new       Thread(this);   //this在这个语句中指的是什么   ?  
    t.start();      
    }      
请高手给我讲解一下this的用法,有点懵.

------解决方案--------------------
可以理解为UpDown2的一个对象
------解决方案--------------------
this就是指向自身的一个指针,在你这里就是UpDown2
------解决方案--------------------
class UpDown2 就是这里的this
------解决方案--------------------
this表示调用该方法的应用
------解决方案--------------------
UP!
------解决方案--------------------
class UpDown2 就是这里的this
同意~
------解决方案--------------------
UpDown2 对象