public class withoutmain{ static{ System.out.println("without the main method"); System.exit(0); } } What is the result of attempting to compile and run the program ?

  1. Compile failure

  2. sucessfully compiled, but through exception in run time.

  3. It runs sucessfuly and prints "without the main method"

  4. It runs sucessfuly, but No output.


Correct Option: C

Find more quizzes: