Skip to content

Latest commit

 

History

History
49 lines (46 loc) · 2.44 KB

File metadata and controls

49 lines (46 loc) · 2.44 KB

Collections

  1. Why do we need collections in Java?
  2. What are the important interfaces in the collection hierarchy?
  3. What are the important methods that are declared in the collection interface?
  4. Can you explain briefly about the List interface?
  5. Explain about ArrayList with an example?
  6. Can an ArrayList have duplicate elements?
  7. How do you iterate around an ArrayList using iterator?
  8. How do you sort an ArrayList?
  9. How do you sort elements in an ArrayList using comparable interface?
  10. How do you sort elements in an ArrayList using comparator interface?
  11. What is vector class? How is it different from an ArrayList?
  12. What is linkedList? What interfaces does it implement? How is it different from an ArrayList?
  13. Can you briefly explain about the Set interface?
  14. What are the important interfaces related to the Set interface?
  15. What is the difference between Set and sortedSet interfaces?
  16. Can you give examples of classes that implement the Set interface?
  17. What is a HashSet?
  18. What is a linkedHashSet? How is different from a HashSet?
  19. What is a TreeSet? How is different from a HashSet?
  20. Can you give examples of implementations of navigableSet?
  21. Explain briefly about Queue interface?
  22. What are the important interfaces related to the Queue interface?
  23. Explain about the Deque interface?
  24. Explain the BlockingQueue interface?
  25. What is a priorityQueue?
  26. Can you give example implementations of the BlockingQueue interface?
  27. Can you briefly explain about the Map interface?
  28. What is difference between Map and sortedMap?
  29. What is a HashMap?
  30. What are the different methods in a Hash Map?
  31. What is a TreeMap? How is different from a HashMap?
  32. Can you give an example of implementation of navigableMap interface?
  33. What are the static methods present in the collections class?

Advanced Collections

  1. What is the difference between synchronized and concurrent collections in Java?
  2. Explain about the new concurrent collections in Java?
  3. Explain about copyonwrite concurrent collections approach?
  4. What is compareandswap approach?
  5. What is a lock? How is it different from using synchronized approach?
  6. What is initial capacity of a Java collection?
  7. What is load factor?
  8. When does a Java collection throw UnsupportedOperationException?
  9. What is difference between fail-safe and fail-fast iterators?
  10. What are atomic operations in Java?
  11. What is BlockingQueue in Java?