package andy.chen.jfreechart.frame;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class RefreshThread implements Runnable {
public int i = 0;//系统读取默认值会占用时间(public int i;)
public void run() {
while (true) {
try {
System.out.println(++i);
Thread.sleep(1000);
} catch (InterruptedException ex) {
Logger.getLogger(RefreshThread.class.getName()).log(Level.SEVERE, null, ex);
}
if (i == 6) {
//显示andy.chen.jfreechart.frame.RefreshThread
System.out.println(RefreshThread.class.getName());
return;
}
}
}
}
package andy.chen.jfreechart.frame;
/**
*
* @author Administrator
*/
public class RefreshThreadImp {
public static void main(String[] args){
RefreshThread time = new RefreshThread();
Thread times = new Thread(time);
times.start();
// return;
System.out.println("success");
}
}
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class RefreshThread implements Runnable {
public int i = 0;//系统读取默认值会占用时间(public int i;)
public void run() {
while (true) {
try {
System.out.println(++i);
Thread.sleep(1000);
} catch (InterruptedException ex) {
Logger.getLogger(RefreshThread.class.getName()).log(Level.SEVERE, null, ex);
}
if (i == 6) {
//显示andy.chen.jfreechart.frame.RefreshThread
System.out.println(RefreshThread.class.getName());
return;
}
}
}
}
package andy.chen.jfreechart.frame;
/**
*
* @author Administrator
*/
public class RefreshThreadImp {
public static void main(String[] args){
RefreshThread time = new RefreshThread();
Thread times = new Thread(time);
times.start();
// return;
System.out.println("success");
}
}