多线程
public class Test extends Thread{ public void run(){ outInfo(); } private void outInfo() { for(int i=0;i<20;i++){ System.out.println("年少不上班"); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } public static void main(String[] args) { Test t = new Test(); t.start(); Test e = new Test(); e.start(); } }