Given:
2. package pack.clients; 3. import pack.bing.MyClass; 4. public class Client{ 5. public static void main(String[] args){ 6. MyClass b = new MyClass(); 7. System.out.println(b.getMoney(2000L)); 8. } }
And given that Client.
java resides in the $ROOT directory and is not yet compiled.
There is another class named pack.bing.MyClass, which has a method called getMoney(long)
that returns a value.
MyClass class is compiled and deployed into a JAR file called pack.jar, as shown in the following directory structure.
$ROOT
|-- Client.java
|-- [pack.jar]
|-- pack
|-- bing
|-- MyClass.class
Which are correct about compiling or running the Client class from the $ROOT directory?
(Choose all that apply.)
A and G are correct.
A is correct because it correctly specifies the classpath to pack.
jar and the destination directory.
G is correct because the classpath should include the JAR file and base location of the Client class.
Note: The symbol ":" is used for the path separation, although in real life that character depends on the platform.