练习1
package zuoYe02; public class News { public static void main(String[] args) { Thread t1 = new Thread() { public void run() { for (int i = 1; i <= 20; i++) { System.out.println(i + ".你好,来自线程" + Thread.currentThread().getName()); } } }; Thread t2 = new Thread() { public void run() { for (int i = 1; i <= 20; i++) { System.out.println(i + ".你好,来自线程" + Thread.currentThread().getName()); } } }; t1.start(); t2.start(); } }