{"id":20807785,"url":"https://github.com/devrezaur/java-collections","last_synced_at":"2025-08-10T16:38:08.157Z","repository":{"id":194926210,"uuid":"687278744","full_name":"DevRezaur/java-collections","owner":"DevRezaur","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-07T08:03:45.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T03:46:39.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevRezaur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-05T03:05:19.000Z","updated_at":"2023-09-15T04:03:12.000Z","dependencies_parsed_at":"2024-11-17T19:42:36.298Z","dependency_job_id":null,"html_url":"https://github.com/DevRezaur/java-collections","commit_stats":null,"previous_names":["devrezaur/java-collections"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DevRezaur/java-collections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevRezaur%2Fjava-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevRezaur%2Fjava-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevRezaur%2Fjava-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevRezaur%2Fjava-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevRezaur","download_url":"https://codeload.github.com/DevRezaur/java-collections/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevRezaur%2Fjava-collections/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264149404,"owners_count":23564455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T19:42:32.647Z","updated_at":"2025-07-07T21:33:57.469Z","avatar_url":"https://github.com/DevRezaur.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Collections in Java\n\nThe **Collection** in Java is a framework that provides an architecture to store and manipulate the group of objects.\n\nJava Collections can achieve all the operations that you perform on a data such as **searching, sorting, insertion,\nmanipulation, and deletion**.\n\nJava Collection means a **single unit of objects**. Java Collection framework provides many interfaces such as **Set,\nList, Queue, Deque** and classes such as **ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet,\nTreeSet**.\n\n# Java Collection Hierarchy\n\n![java-collection-hierarchy](./src/main/resources/image/java-collection-hierarchy.png)\n\n\u003chr /\u003e\n\n![collections-hierarchy](./src/main/resources/image/collections-hierarchy.png)\n\n# ArrayList\n\nArrayList is a class that implements **List** interface. The ArrayList class has a **regular array** inside it. When\nan element is added, it is placed into the array. If the array is not big enough, a new, larger array is created to\nreplace the old one and the old one is removed.\n\n* Implements List interface\n* Maintains insertion order\n* Internal data structure is regular array\n* Dynamic size\n* Allows duplicates and any number of null values\n* Can not use primitive data type (int, float, double, string)\n* Best for storing and accessing data\n\n# LinkedList\n\nLinkedList is a class that implements **List** and **Deque** interface. The functionality and behaviour of LinkedList\nclass is similar to **ArrayList**. main difference is in their internal implementation. ArrayList uses regular array\nand LinkedList uses actual linked list as the internal implementation.\n\n* Implements List and Deque interface\n* Maintains insertion order\n* Internal data structure is doubly linked list\n* Dynamic size\n* Allows duplicates and any number of null values\n* Cannot use primitive data type (int, float, double, string)\n* Best for manipulating data\n\n# HashMap\n\nHashMap is a class that implements **Map** interface. The functionality and behaviour of HasMap is similar to map. That\nmeans it doesn't allow any duplicate keys. And only one null key is accepted.\n\n* Implements Map interface\n* Doesn't insertion order\n* Internal data structure is hash table\n* Dynamic size\n* Allows no duplicate key and only one null key\n* Cannot use primitive data type (int, float, double, string)\n* Best for quickly retrieving values based on particular keys\n\n# LinkedHashMap\n\nLinkedHashMap is a class that implements **Map** interface. The functionality and behaviour of HasMap is similar to map.\nThat means it doesn't allow any duplicate keys. And only one null key is accepted.\n\n* Implements Map interface\n* Maintains insertion order\n* Internal data structure is hashed map and doubly linked list\n* Dynamic size\n* Allows no duplicate key and only one null key\n* Cannot use primitive data type (int, float, double, string)\n* Best for key-value pair data that needs to maintain insertion order\n\n# HashSet\n\nHashSet is a class that implements **Set** interface. The functionality and behaviour of HasSet is similar to set. That\nmeans it doesn't allow any duplicates. And only one null value is accepted.\n\n* Implements Set interface\n* Doesn't maintain insertion order\n* Internal data structure is hash table\n* Dynamic size\n* Doesn't allow duplicates and only one null value is acceptable\n* Can not use primitive data type (int, float, double, string)\n* Best for storing unique data\n\n# TreeSet\n\nTreeSet is a class that implements **NavigableSet** interface. The functionality and behaviour of TreeSet is similar to\nset that maintains insertion order.\n\n* Implements NavigableSet interface\n* Doesn't insertion order\n* Sorts element upon insertion\n* Internal data structure is red-black tree\n* Dynamic size\n* Doesn't allow duplicates and null values\n* Can not use primitive data type (int, float, double, string)\n* Best for storing unique data while maintaining insertion order","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevrezaur%2Fjava-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevrezaur%2Fjava-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevrezaur%2Fjava-collections/lists"}