Multiple choice technology programming languages

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

  1. Message Hello

  2. I am in Constructor

  3. Compiler Error

  4. Exception

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

The class has two overloaded main methods - one with String[] args and one with String args. When the JVM launches, it calls the standard main(String[] args) which invokes the no-arg constructor, printing 'I am in Constructor'. The second main method is never called.