Java Basic


  1. Which of the following is true about Java system properties?











  1. 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.


  1. What does System.getProperty(“variable”) return?











  1. 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.



  1. Which system property stores installation directory of JRE?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    java.home is the installation directory of Java Runtime Environment.


  1. Java system properties can be set at runtime.











  1. 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.



  1. What is true about the setProperties method?











  1. 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.