Regarding question about 'main.class'

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
yogesh.jankin
Posts: 1
Joined: Wed Apr 02, 2014 5:37 pm
Contact:

Regarding question about 'main.class'

Post 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.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Regarding question about 'main.class'

Post by admin »

The question asks you to run it as well.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests