Run ❯
Get your
own Java
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
public class Main { static class MyThread extends Thread { public void run() { System.out.println("While running: " + isAlive()); } } public static void main(String[] args) throws InterruptedException { MyThread thread = new MyThread(); System.out.println("Before start: " + thread.isAlive()); thread.start(); thread.join(); System.out.println("After join: " + thread.isAlive()); } }
Before start: false
While running: true
After join: false