总结:线程的理解不够。还不够

package com.aa;

public class MyThread implements Runnable {// 我们可以继承一个Thread.但是我们可以实现Runnabel接口

	public void run() {
		for (int i = 0; i < 100; i++) {
			System.out.println("你是我的信仰");
			System.out.println("谁说的?");
			System.out.println(i);
		}

	}

	public static void main(String[] args) {
		MyThread t = new MyThread();
		new Thread(t).start();// 创建并启动一个线程
	}

}
////
你是我的信仰
谁说的?
0
你是我的信仰
谁说的?
1
你是我的信仰
谁说的?
2
你是我的信仰
谁说的?
3

  

相关文章:

  • 2021-04-27
  • 2021-05-16
  • 2021-11-24
  • 2022-12-23
  • 2022-01-01
  • 2021-04-14
  • 2022-01-14
猜你喜欢
  • 2021-08-06
  • 2021-05-09
  • 2021-07-07
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
相关资源
相似解决方案