Understanding Java Compilation: -sourcepath and -classpath Explained - Quiz
Total: 5 questions
1. Which option should be used with the java command to set a system property?
Which option should be used with the java command to set a system property?
-D option
2. Launch the class named MyNewClass.class with two String arguments with values ex and 5. And create a system property called myNewProp with value myNewValue.
Launch the class named MyNewClass.class with two String arguments with values ex and 5. And create a system property called myNewProp with value myNewValue.
java -DmyNewProp=myNewValue MyNewClass ex 5
3. How to get Properties object?
How to get Properties object?
Properties p = System.getProperties();
4. Where does java and javac look for the classes?
Where does java and javac look for the classes?
First they look in the directories with standard Java SE (J2SE) classes. Then they look in the directories defined by classpaths.
5. Where classpaths can be declared?
Where classpaths can be declared?
It can be declared as an operating system environment variable or as a command-line option.
Page 1 of 1