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();
    }
}
Explanation
Code will not compile.
InterruptedException should be processed in the run() method.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback