运行 ❯
获取您
自己的Java
服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
public class Main extends Thread { public static void main(String[] args) { Main thread = new Main(); thread.start(); System.out.println("This code is outside of the thread"); } public void run() { System.out.println("This code is running in a thread"); } }
这段代码在线程之外
这段代码正在线程中运行