Java Basic


  1. Which one of the following contains date information?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    java.sql.Time contains only time. Whereas, java.sql.TimeStamp contains both time and date.


  1. Which of the following is advantage of using PreparedStatement in Java?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    PreparedStatement in Java improves performance and also prevents from SQL injection.



  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.