java多线程-------------基础的Thread.CURRNET

总结:感觉不是太难,不过我写出来了,但竟然不理解它的意思?多线程就是多个任务同时进行

public class Test2 {
	public static void main(String[] args) {
		for (int i = 0; i < 100; i++) {
			System.out.println(i);// ok解决了。
			try {
				Thread.currentThread().sleep(100);// 睡眠时间如何实现
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}

	}
}

这里有个睡眠时间,数字是一个一个的输出的

  

原文地址:https://www.cnblogs.com/langlove/p/3472264.html