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() { try { Thread.sleep(5000); System.out.println("The thread woke up"); } catch (InterruptedException e) { System.out.println("The thread was interrupted"); } } } public static void main(String[] args) throws InterruptedException { MyThread thread = new MyThread(); thread.start(); thread.interrupt(); thread.join(); } }
The thread was interrupted