1. It will fail to compile.
  2. Runtime error
  3. Compiles and runs with no output.
  4. Compiles and runs printing

Share with your friends
AhmedNazir

Call

Answer: Option 4

This will compile and print "Hello". The entry point for a standalone java program is the main method of the class that is being run. The java run-time system will look for that method in class Test and find that it should have such a method. It does not matter whether it is defined in the class itself or is inherited from a parent class.

Talk Doctor Online in Bissoy App