I am taking up SCJP 6 and came across a question which is as follows.
Given:
2. import rt.utils.Remote;
3. public class Controller{
4. public static void main(String[] args){
5. Remote remote = new Remote();
6. } }
And rt.utils.Remote class is properly bundled into a JAR file called rtutils.jar.
And given the following steps:
P. Place rtutils.jar in the $ROOT directory.
Q. Extract rtutils.jar and put rt directory with its subdirectories in the $ROOT directory.
R. Extract rtutils.jar and place Remote.class in the $ROOT directory.
S. Place rtutils.jar in the $JAVA_HOME/jre/lib/ext directory.
X. Compile using: javac -cp rtutils.jar Controller.java
Y. Compile using: javac Controller.java
Z. Compile using: javac -cp . Controller.java
If Controller.java resides in the $ROOT directory, which set(s) of steps will compile the
Controller class? (Choose all that apply.)
A. P -> X
B. Q -> Y
C. R -> Z
D. P -> Z
E. R -> Y
F. S -> X
G. S -> Z
As per the book the answer is A B F and G I am not getting a proper explanation which justifies those answers are right. It would be grateful if someone can explain. This is SE 6 Java.