Multiple choice general knowledge science & technology

Given the following: class MyThread extends Thread{ public static void main(String [] args){ MyThread t=new MyThread(); Thread x=new Thread(t); x.start(); public void run(){ for(int i=0;i<3;++i) System.out.print(i+”..”); } } } what is the result of above code?

  1. compile-time error

  2. run-time error

  3. 0..1..2..

  4. 0..1..2..3..

  5. 1..2..3..

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The code has a compile-time error. The main method is missing its closing brace - line 8 starts the try block but the main method never closes before the run method is declared. This makes the code structurally invalid and it will not compile.