package edu.mama.ls18.homework;
public class PrintNameRunnable implements Runnable {
@Override
public void run() {
for (int i = 0; i < 5; i++) {
System.out.println(Thread.currentThread().getName());
//加入sleep,可以看到A和C交替的效果<br /> try {<br /> Thread._sleep_(10);<br /> } catch (InterruptedException e) {<br /> e.printStackTrace();<br /> }<br /> }<br /> }<br />}