Page 1 of 1

Regarding question about 'main.class'

Posted: Wed Apr 02, 2014 5:45 pm
by yogesh.jankin
Hi Admin,

For the below question, please let me know why option 2 is wrong as I'm able to compile it without error:

The options below contain the complete contents of a file (the name of the file is not specified). Which of these options can be run with the following command line once compiled?
java main

Option 2 is :
//in file main.java    
public static void main4(String[] args) {       
 System.out.println("hello");    }

Thanks,Yogesh.

Re: Regarding question about 'main.class'

Posted: Wed Apr 02, 2014 8:35 pm
by admin
The question asks you to run it as well.