If the following program is saved in file named "
Correct Answer : D
As the file name is
HelloWorld.java we must compile it using
HelloWorld.java that is
The class having
main method is named
HelloWorld. In order to run we need to give the class name having
main method. So we run it using class name i.e.,
So, answer is D.