What will happen after the following code is compiled and executed?

public class Main implements Runnable {
    public void run() {
        System.out.println("Hello");
        Thread.currentThread().sleep(100);        
    }        
    public static void main(String... args) throws InterruptedException {
        new Thread(new Main()).start();
    }
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes