HowToDoInJava

  • Python
  • Java
  • Spring Boot
  • Dark Mode

Java Collections Tutorials

Java collections framework is a unified architecture for representing and manipulating collections. All collections frameworks contain the following:

Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.

Implementations, i.e., Classes: These are the concrete implementations of the collection interfaces. In essence, they are reusable data structures.

Algorithms: These are the methods that perform useful computations, such as searching and sorting, on objects that implement collection interfaces. The algorithms are said to be polymorphic: that is, the same method can be used on many different implementations of the appropriate collection interface.

In addition to collections, the framework defines several map interfaces and classes. Maps store key/value pairs. Although maps are not collections in the proper use of the term, but they are fully integrated with collections.

  1. Java CopyOnWriteArraySet class
  2. Java CopyOnWriteArrayList class
  3. Java TransferQueue – Java LinkedTransferQueue class
  4. Java ArrayBlockingQueue class
  5. Java PriorityBlockingQueue class
  6. Java PriorityQueue class
  7. Java Spliterator interface
  8. Java ListIterator interface
  9. Java Iterator interface example
  10. Java Comparator interface example
  11. Java Comparable interface example
  12. Java LinkedList class
  13. Java TreeSet class
  14. Java LinkedHashSet class
  15. Java HashSet class
  16. Java Hashtable class
  17. Java TreeMap class
  18. Java LinkedHashMap class
  19. How to clone HashMap – Shallow and Deep Copy
  20. How to remove duplicate elements in ArrayList
  21. How to Synchronize HashMap in Java
  22. How to join or merge two hashmaps in Java
  23. How to compare two hashmaps in Java
  24. ArrayList spliterator() method example
  25. ArrayList removeIf() – remove objects by field
  26. ArrayList sort() – Sort list of objects by field
  27. ArrayList replaceAll() method example
  28. ArrayList retainAll() method example
  29. ArrayList removeAll() – remove all occurrences from list
  30. ArrayList remove() method example
  31. ArrayList listIterator() method example
  32. ArrayList forEach() example – Java 8
  33. ArrayList clone() – Deep copy and shallow copy
  34. ArrayList clear() – Empty ArrayList in Java
  35. ArrayList addAll() method example
  36. ArrayList add() method example
  37. Difference between LinkedList vs ArrayList in Java
  38. Difference between ArrayList vs Vector in Java
  39. How to convert HashSet to ArrayList in Java
  40. Convert array to list in Java
  41. How to convert ArrayList to String Array in Java
  42. How to convert LinkedList to ArrayList in Java
  43. How to convert Vector to ArrayList in Java
  44. Java ArrayList toArray() – Convert ArrayList to Array
  45. Java ArrayList contains() – Check if element exists
  46. Java ArrayList ensureCapacity() method example
  47. How to replace existing element in ArrayList
  48. Check if ArrayList is empty or not in Java
  49. How to empty or clear ArrayList in Java
  50. How to merge two ArrayLists in Java
  51. How to serialize and deserialize ArrayList in Java
  52. How to swap two elements in ArrayList in Java
  53. How to synchronize ArrayList in Java
  54. How to compare two ArrayLists in Java
  55. ArrayList get() method – Getting Element at Index
  56. Arraylist indexOf() – Get index of element in arraylist
  57. Arraylist lastIndexOf() – Get last index of element in arraylist in Java
  58. Get sublist of ArrayList – ArrayList subList() method
  59. Add multiple items to ArrayList in Java
  60. How to remove element from ArrayList in Java
  61. ArrayList add/replace element at specified index in Java
  62. How to iterate through ArrayList of objects in Java
  63. How to initialize ArrayList in Java
  64. Create List with Single Element
  65. Java Iterate List Examples
  66. Different ways to iterate over Collections in Java
  67. Difference between enumerator and iterator?
  68. How Iterator works in java
  69. Difference between HashMap vs Hashtable in Java
  70. Top 40 Java collection interview questions and answers
  71. How to design good custom key object for HashMap
  72. Use Array instead of Vector.elementAt() for Better Performance
  73. Performance Comparison of Different Ways to Iterate over HashMap
  74. Performance Comparison – Different For Loops in Java
  75. How HashMap works in Java

Search Tutorials

Java Collections

  • Collections Framework
  • Array
  • ArrayList
  • LinkedList
  • HashMap
  • Hashtable
  • LinkedHashMap
  • TreeMap
  • HashSet
  • LinkedHashSet
  • TreeSet
  • Comparable
  • Comparator
  • Iterator
  • ListIterator
  • Spliterator
  • PriorityQueue
  • PriorityBlockingQueue
  • ArrayBlockingQueue
  • LinkedTransferQueue
  • CopyOnWriteArrayList
  • CopyOnWriteArraySet
  • Collection Sorting
  • Interview Questions

Java Tutorial

  • Java Introduction
  • Java Keywords
  • Java Flow Control
  • Java OOP
  • Java Inner Class
  • Java String
  • Java Enum
  • Java Collections
  • Java ArrayList
  • Java HashMap
  • Java Array
  • Java Sort
  • Java Clone
  • Java Date Time
  • Java Concurrency
  • Java Generics
  • Java Serialization
  • Java Input Output
  • Java New I/O
  • Java Exceptions
  • Java Annotations
  • Java Reflection
  • Java Garbage collection
  • Java JDBC
  • Java Security
  • Java Regex
  • Java Servlets
  • Java XML
  • Java Puzzles
  • Java Examples
  • Java Libraries
  • Java Resources
  • Java 14
  • Java 12
  • Java 11
  • Java 10
  • Java 9
  • Java 8
  • Java 7

Meta Links

  • About Me
  • Contact Us
  • Privacy policy
  • Advertise
  • Guest and Sponsored Posts

Recommended Reading

  • 10 Life Lessons
  • Secure Hash Algorithms
  • How Web Servers work?
  • How Java I/O Works Internally?
  • Best Way to Learn Java
  • Java Best Practices Guide
  • Microservices Tutorial
  • REST API Tutorial
  • How to Start New Blog

Copyright © 2020 · HowToDoInjava.com · All Rights Reserved. | Sitemap

  • Java 15 New Features
  • Sealed Classes and Interfaces
  • EdDSA (Ed25519 / Ed448)