Java Basic


  1. Which attribute is used to specify destroy method?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    destroy-method is used to specify the destruction method.


  1. Which of the following is advantage of using JDBC connection pool?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Since the JDBC connection takes time to establish. Creating connection at the application start-up and reusing at the time of requirement, helps performance of the application.



  1. Which of the following contains both date and time?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    java.util.date contains both date and time. Whereas, java.sql.date contains only date.


  1. How to specify autowiring by name?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Different beans of the same class are identified by name.



  1. Which is better in terms of performance for iterating an array?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    reverse traversal of array take half number cycles as compared to forward traversal. The other for loops will go in infinite loop.