A

Admin • 828.03K Points
Coach

Q. You have the following code in a file called Test.java
class Base{
public static void main(String[] args){
System.out.println("Hello");
}
}
public class Test extends Base{}

What will happen if you try to compile and run this?

  • (A) It will fail to compile.
  • (B) Runtime error
  • (C) Compiles and runs with no output.
  • (D) Compiles and runs printing
  • Correct Answer - Option(D)
  • Views: 19
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
This will compile and print "Hello".

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.