without creating any object of the class, can the method be executed? I met the following question, would any one please help me out:
public class C{
public static void main(String[] args){
System.out.println("Run");
}
}
public class D extends C{
}
Once the program is compiled you execute the following from the command line.
java D
Select the result of compiling and executing the program in this way.
A.the program will not compile because D does not contain a main method.
B. the program compiles and prints Run to the system console.
C.the program compiles but doesn't print anything to the system console.
D.the program compiles but the Java interpreter gives an error when you try to run D stating that class D does not contain a main method.
the question is from the mock exam in :
http://joppa.appliedreasoning.com/JavaCertification.html