Problem1228--Java 多线程程序

1228: Java 多线程程序

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 2  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

使用多线程输出 Hello World。

  public class Java_2 {
 
    public static void main(String args[]) {
        Hello h = new Hello();
        Thread t=___________________;	
        t.start();
    }
}
 
class Hello implements _______________ {
    int i = 0;
 
    public void run() {
        while (true) {
            System.out.println("Hello!");
            if (i++ == 5) {
                break;
            }
        }
    }
}

Source/Category