Which two java commands entered at the command line will run MainClass?

Given:
1. package com.company.application;
2.
3. public class MainClass {
4. public static void main(String[] args) {}
5. }
And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH
environment variable is set to “.” (current directory).
Which two java commands entered at the command line will run MainClass? (Choose two.)

Given:
1. package com.company.application;
2.
3. public class MainClass {
4. public static void main(String[] args) {}
5. }
And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH
environment variable is set to “.” (current directory).
Which two java commands entered at the command line will run MainClass? (Choose two.)

A.
java com.company.application.MainClass if run from the /apps/com/company/application
directory

B.
java -classpath . MainClass if run from the /apps/com/company/application directory

C.
java MainClass if run from the /apps directory

D.
java -classpath /apps/com/company/application:. MainClass if run from the /apps directory

E.
java -classpath /apps com.company.application.MainClass if run from any directory

F.
java com.company.application.MainClass if run from the /apps directory



Leave a Reply 0

Your email address will not be published. Required fields are marked *