package com.gxf.basic;
public class ThisDemo {
int i=1;
public ThisDemo(){
Thread thread=new Thread(){
public void run(){
for(;;){
ThisDemo.this.run();
try{
sleep(1000);
}catch(Exception e){
e.printStackTrace();
}
}
}
};
thread.start();
}
public void run(){
System.out.println(i);
i++;
}
public static void main(String[] args) {
new ThisDemo();
}
}