Java Basic
- Which of the following is true about Java system properties?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Java system properties are only used and accessible by the processes they are added.
- What does System.getProperty(“variable”) return?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
System.getProperty(“variable”) returns null value. Because, variable is not a property and if property does not exist, this method returns null value.
- Which system property stores installation directory of JRE?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
java.home is the installation directory of Java Runtime Environment.
- Java system properties can be set at runtime.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
Java system properties can be set at runtime using System.setProperty(name, value) or using System.getProperties().load() methods.
- What is true about the setProperties method?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The changes made by the setProperties method are not persistent. Hence, it does not affect future invocation.