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 MainClass if run from the /apps directory B. java com.company.application.MainClass if run from the /apps directory C. java -classpath /apps com.company.application.MainClass if run from any directory D. java -classpath . MainClass if run from the /apps/com/company/application directory E. java -classpath /apps/com/company/application:. MainClass if run from the /apps directory F. java com.company.application.MainClass if run from the /apps/com/company/application directory
Reveal answer
Fill a bubble to check yourself
Keep practicing — related questions
- Suppose you are using a Windows operating system and you wish to run an application. The application class ...
- Given two files: 1. class One { 2. public static void main(String[] args) { 3. int assert = 0; 4. } 5. } 1....
- We have a public class with a proper main method. Which of the following options helps us in supplying the ...
- We have a public class with a proper main method. Which of the following options helps us in supplying the ...
- If MyProg.java were compiled as an application and then run from the command line as: java MyProg I like te...
- A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main ...
- Given the following two classes, which statement is true? ---------- class-1 ---------- package pack; publi...
- class A { public static void main(String args[]) { System.out.println(args.length); } } what is the output ...