/**
* 作者repairbug 资料来源于【圣才学习网】http://www.100itxx.com
*/
package com.stringtree.oa.thread.anony;
/**
* @author Administrator
*
*/
public class AnomyClassThread {
public void begin(){
//Runnable接口实例
Runnable r = new Runnable(){
//重写run方法
public void run() {
// TODO Auto-generated method stub
int j = 0;
for(int i = 0;i<10000;i+=5){
System.out.print("i["+( j++ )+"]="+i+",");
if(i% 100 == 0){
System.out.println();
}
}
}
};
Thread t = new Thread(r);
System.out.println(4);
t.start();
System.out.println(5);
}
/**
*
*/
public AnomyClassThread() {
// TODO Auto-generated constructor stub
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(1);
//启动主线程
AnomyClassThread act = new AnomyClassThread();
System.out.println(2);
act.begin();
System.out.println(3);
}
}