public class Main { public static void main(String[] args) throws InterruptedException { Thread t = new Thread(() -> { // TODO: print "Hello from thread" }); t.start(); t.join(); System.out.println("Main done"); } }
Output
Click Run to execute, or Check to validate.
Ask questions or share tips about this tutorial
Sign in to join the discussion