Java Basic


  1. Which of these package is used for text formatting in Java programming language?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    java.text allows formatting, searching and manipulating text.


  1. How to read a classpath file?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    This method can be used to load files using relative path to the package of the class.



  1. Which environment variable is used to set java path?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    JAVA_HOME is used to store a path to the java installation.


  1. How to assign values to variable using property?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    @Value are used to inject the properties and assign them to variables.



  1. How to use environment properties in the class?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    @Autowired
    private Environment env;