- A The program will fail to compile.
- B The program will compile and run, but the main method will not be executed.
- C The program will compile and run, but it will generate a runtime error.
- D The program will compile and run normally.
- Share this MCQ
Answer:
D
Share this MCQ
If the static modifier is removed from the main method in Java, the program will still compile and run normally. This is because the main method is the entry point of the program and the JVM will still be able to find it. However, if the main method is not declared as static, the program will not be able to access any static members of the class.
Click me to Read more Question & Answer of Java Interviews MCQsShare this MCQ