Multiple choice technology programming languages

package simplejava;public class TestMain1 { TestMain1() { System.out.println("I am in Constructor"); } TestMain1(String message) { System.out.println("Message " + message); } public void main(String[] args) { TestMain1 nm = new TestMain1(); TestMain1 nm1 = new TestMain1("Hello"); }}

  1. Compiler Error

  2. Exception

  3. I am in Constructor

  4. Message Hello

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

The main method is not declared static, which is required by the JVM. When you try to run this class, the JVM cannot find a valid entry point and will throw an exception at runtime stating that the main method must be static.