Java Basic


  1. In which file database table configuration is stored?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Database table configuration is stored in .hbm file.


  1. Which of the following is not an advantage of Hibernate Criteria API?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    addOrder() can be used for ordering the results.



  1. What should the return type of method where there is no return value?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Returning Empty collection is a good practice. It eliminates chances of unhandled null pointer exceptions.


  1. What data structure should be used when number of elements is fixed?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Array list has variable size. Array is stored in contiguous memory. Hence, reading is faster. Also, array is memory efficient.



  1. Which of the below is true about java class structure?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Class name should always start with upper case and contain those attribute and functionality which it should (Single Responsibility Principle); hence keeping it short. The attributes should be usually private with get and set methods.