Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 subjective questions Collections and Java Database Programming

CSE310 — Programming In Java 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    What are Generics in Java? Explain how to create a collection using generics with a code example.

  2. Question 2 of 20

    Explain the implementation of the ArrayList class. Discuss its performance in terms of access and manipulation time complexity.

  3. Question 3 of 20

    Differentiate between the Comparable and Comparator interfaces in Java with respect to the TreeSet implementation.

  4. Question 4 of 20

    Write a Java program to implement a TreeSet that stores Student objects (id, name) and sorts them by name using the Comparator interface.

  5. Question 5 of 20

    Explain the internal working of a HashMap in Java. How are collisions handled?

  6. Question 6 of 20

    What is a Deque? Explain the implementation of ArrayDeque with its advantages over LinkedList.

  7. Question 7 of 20

    Explain the JDBC Architecture with the help of a diagrammatic representation description.

  8. Question 8 of 20

    List and explain the four types of JDBC Drivers.

  9. Question 9 of 20

    Why is the Type-4 JDBC driver considered the most efficient for web applications?

  10. Question 10 of 20

    Outline the standard steps required to connect a Java application to a Database using JDBC.

  11. Question 11 of 20

    Distinguish between Statement and PreparedStatement in JDBC. Which one protects against SQL Injection?

  12. Question 12 of 20

    Write a JDBC code snippet to perform a CRUD Insert operation using PreparedStatement.

  13. Question 13 of 20

    Explain the ResultSet interface. What are the differences between executeQuery, executeUpdate, and execute methods?

  14. Question 14 of 20

    Write a Java program to retrieve and display data (Select operation) from a database table named Employees.

  15. Question 15 of 20

    What is meant by connecting to 'Non-conventional Databases'? Explain how Java connects to NoSQL databases like MongoDB.

  16. Question 16 of 20

    Differentiate between Array and ArrayList in Java.

  17. Question 17 of 20

    Explain the different ways to iterate over a HashMap.

  18. Question 18 of 20

    Explain the concept of Transaction Management in JDBC with the commit and rollback methods.

  19. Question 19 of 20

    What is ListIterator? How is it different from Iterator?

  20. Question 20 of 20

    What are the core interfaces of the Java Collections Framework? Briefly describe the hierarchy.

That's unit 6

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.