62,634
社区成员




/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package exp1;
/**
*
* @author szhu5
*/
public class TestThread
{
public static void main(String [] args)
{
Runner1 r1 = new Runner1();
Thread td = new Thread(r1);
td.start();
for (int j = 1; j < 100 ;j++ )
{
System.out.println("Thread :" + j);
}
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package exp1;
/**
*
* @author szhu5
*/
public class Runner1 implements Runnable
{
public void run ()
{
for (int i = 0; i <100 ;i++ )
{
System.out.println("runner1:" + i);
}
}
}
public class TestThread {
public static void main(String[] args) {
Runner1 r1 = new TestThread().new Runner1();
Thread td = new Thread(r1);
td.start();
for (int j = 1; j < 100; j++) {
System.out.println("Thread :" + j);
}
}
class Runner1 implements Runnable {
public void run() {
for (int i = 0; i < 100; i++) {
System.out.println("runner1:" + i);
}
}
}
}
public class TestThread {
public void test() {
Runner1 r1 = new Runner1();
Thread td = new Thread(r1);
td.start();
for (int j = 1; j < 100; j++) {
System.out.println("Thread :" + j);
}
}
public static void main(String[] args) {
TestThread testThread = new TestThread();
testThread.test();
}
class Runner1 implements Runnable {
public void run() {
for (int i = 0; i < 100; i++) {
System.out.println("runner1:" + i);
}
}
}
}