{"id":21871949,"url":"https://github.com/avinandanbose/java-collection-framework-and-java-set","last_synced_at":"2025-07-17T22:35:56.554Z","repository":{"id":63986227,"uuid":"572203901","full_name":"AvinandanBose/Java-Collection-Framework-and-Java-Set","owner":"AvinandanBose","description":"This is all about Java Collection Framework and Java Set.","archived":false,"fork":false,"pushed_at":"2023-01-26T16:53:11.000Z","size":217,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-22T00:03:31.830Z","etag":null,"topics":["collection","collections","java","java4","java5","java6","java8","java9","javacollection","javacollections","javacore","set"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AvinandanBose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-29T19:16:02.000Z","updated_at":"2025-01-12T14:19:41.000Z","dependencies_parsed_at":"2023-02-14T19:46:26.977Z","dependency_job_id":null,"html_url":"https://github.com/AvinandanBose/Java-Collection-Framework-and-Java-Set","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/AvinandanBose/Java-Collection-Framework-and-Java-Set","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collection-Framework-and-Java-Set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collection-Framework-and-Java-Set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collection-Framework-and-Java-Set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collection-Framework-and-Java-Set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AvinandanBose","download_url":"https://codeload.github.com/AvinandanBose/Java-Collection-Framework-and-Java-Set/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvinandanBose%2FJava-Collection-Framework-and-Java-Set/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265672372,"owners_count":23808845,"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":["collection","collections","java","java4","java5","java6","java8","java9","javacollection","javacollections","javacore","set"],"created_at":"2024-11-28T06:15:54.158Z","updated_at":"2025-07-17T22:35:56.533Z","avatar_url":"https://github.com/AvinandanBose.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Collection Framework and Java-Set\nThis is all about Java Collection.\n\n\n\u003ch3\u003e \u003ci\u003e java.util \u003c/i\u003e →Package contains  the collection classes let us to group elements in various ways . The Collection Classes also define several methods that provide easier way of working with items . These classes are important , not just for their but because many other Java methods use or return objects of these classes such as the \u003ci\u003eArrayList\u003c/i\u003e and \u003ci\u003eHashMap\u003c/i\u003e classes. Collection package added to JSE 1.2 Java SE 8 has significantly increased the power and streamlined the use of collection framework. \u003c/h3\u003e\n\n\u003ch2\u003e \u003cins\u003e The Collection Framework Interfaces \u003c/ins\u003e\u003c/h2\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e1.Collection\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e2.Deque\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e3.List\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e4.Set\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e5.Map\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e6.Sorted Set\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e7.Sorted Map\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e8.Queue\u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e\u003ch3\u003e9.Navigable Set\u003c/h3\u003e \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003e \u003cins\u003e1. The Collection Interface \u003c/ins\u003e \u003c/h2\u003e\n\n\u003cbr\u003e\n  \n```Syntax\n\nCollection: It is the top of the collection hierarchy. It supports basic grouping of elements.\n\n```\n\u003ch3\u003eThe Collection interface is the foundation upon which the Collections Framework is built because it must be implemented by any class that defines a collection.Collection is a generic interface that has this declaration:\u003c/h3\u003e\n\n\u003ch3 align=\"center\"\u003e\n \n ```Syntax\n \n interface Collection\u003cE\u003e\n \n ```\n\n\u003c/h3\u003e\n\n\u003ch3\u003e Here E specifies the type of objects that the Collection will hold. Consider an example: \u003c/h3\u003e\n\n\u003ch3 align=\"center\"\u003e\n \n ```Syntax\n \n Collection\u003cString\u003e co\n \n ```\n\n\u003c/h3\u003e\n\n\u003ch3\u003eThe above example can be a List, a Set, or another kind of Collection.\u003c/h3\u003e\n\n\u003cul\u003e\n\u003cul\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/javacollection1.java\" \u003e Java Collection [Eg -1]\u003c/a\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/javacollection2.java\" \u003e Java Collection [Eg -2]\u003c/a\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/javacollection3.java\" \u003e Java Collection [Eg -3]\u003c/a\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/javacollection4.java\" \u003e Java Collection [Eg -4]\u003c/a\u003e\u003c/h3\u003e\n\u003c/ul\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eInterface\u003c/th\u003e\n    \u003cth\u003eHash Table\u003c/th\u003e\n    \u003cth\u003eResizable Array\u003c/th\u003e \n   \u003cth\u003eBalanced Tree\u003c/th\u003e \n   \u003cth\u003eLinked List\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eCollection\u003c/td\u003e\n  \u003ctd \u003eHashSet\u003c/td\u003e \n  \u003ctd \u003eArrayList\u003c/td\u003e \n  \u003ctd \u003eTreeSet\u003c/td\u003e\n  \u003ctd \u003eLinked List\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n  \n\u003ch3\u003e  \n \n```Syntax\n\nThat is we can create an instance of HashSet, ArrayList, TreeSet \nand LinkedList Class,through the help of Collection interface.\n\n\n```\n\n\u003ch2\u003e \u003cins\u003e 2 . Sets \u003c/ins\u003e\u003c/h2\u003e  \n  \n  \n```mermaid\ngraph TD;\n    Collection--\u003eSet;\n    Set--\u003eHashSet;\n    Set--\u003eSortedSet;\n    HashSet--\u003eLinkedHashSet;\n    SortedSet--\u003eNavigableSet;\n    NavigableSet--\u003eTreeSet;\n    \n```\n\n  ```Syntax\n\nCollection: It is the top of the collection hierarchy. It supports basic grouping of elements.\n  \nSet: It extends Collection to implement sets, in which all elements must be unique.\n  \nSortedSet: It extends Set to implement a sorted set.\n  \nHashSet:  It extends Set to implement a hash set.\n\nLinkedListSet:   It extends HashSet to implement a Linked List Set.\n\nNavigableSet:   It extends SortedSet to implement a Navigable Set.\n  \nTree Set:   It extends NavigableSet to implement a Tree Set.\n```\n\n```mermaid\ngraph TD;\n    \n    Set--\u003eHashSet;\n    Set--\u003eTreeSet;\n   \n    \n```\n  \n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eInterface\u003c/th\u003e\n    \u003cth\u003eHash Table\u003c/th\u003e\n    \u003cth\u003eResizable Array\u003c/th\u003e \n   \u003cth\u003eBalanced Tree\u003c/th\u003e \n   \u003cth\u003eLinked List\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eSet\u003c/td\u003e\n  \u003ctd \u003eHashSet\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeSet\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e  \n\n\u003cul\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/setDemo.java\" \u003e Set→HashSet [Eg -1]\u003c/a\u003e\u003c/h3\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/setDemo1.java\" \u003e  Set→TreeSet  [Eg -2]\u003c/a\u003e\u003c/h3\u003e\n\n\n```Syntax\n\nThat is we can create an instance of TreeSet, HashSet,\nthrough the help of Set Interface.\n\n:HashSet:\n___________\n→It implements Set Interface.\n→ Every elements entered are unique i.e. No duplicates.\n→ HashSet stores the elements by using a mechanism called hashing.\n→ HashSet allows null value.\n→ HashSet doesn't maintain the insertion order. \n  Here, elements are inserted on the basis of their hashcode.\n  \n:TreeSet:\n___________\n→It implements Set Interface.\n→TreeSet class access and retrieval times are quiet fast.\n→TreeSet class doesn't allow null element.\n→TreeSet class maintains ascending order. \n→TreeSet class contains unique elements only like HashSet.\n```\n\n\u003ch2\u003e Calculation of HashCode  \u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e 1. Integers \u003c/h3\u003e \u003c/li\u003e\n\u003cul\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/hashcodeDemo1.java\" \u003e HashCode Of Integers [Eg -1]\u003c/a\u003e\u003c/h3\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e 2. Strings \u003c/h3\u003e \u003c/li\u003e\n\u003cul\u003e\n\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/hashcodeDemo2.java\" \u003e HashCode Of Strings [Eg -2]\u003c/a\u003e\u003c/h3\u003e\n\u003c/ul\u003e\n\n\n```Syntax\n\n:HASH CODE OF INTEGERS:\n\nHASH CODE OF 1 → 1\nHASH CODE OF 2 → 2\nHASH CODE OF 3 → 3\n\n                  ......etc.\n                  \n:HASH CODE OF STRINGS:\n\nHASH CODE OF A → 65 //ASCII CODE\nHASH CODE OF B → 66 //ASCII CODE\nHASH CODE OF C → 67 //ASCII CODE\n                    ......etc.\n\n```\n\n\u003c/ul\u003e\n  \n\u003ch1 align=\"center\"\u003e  HashSet Functionality:  \u003c/h1\u003e\n \u003cul\u003e\n   \u003cli\u003e \u003ch3\u003e 1. Add \u003c/h3\u003e \u003c/li\u003e\n   \u003cul\u003e\n     \u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo.java\" \u003e HashSet [Add]\u003c/a\u003e\u003c/h3\u003e\n    \u003c/ul\u003e\n    \n```Syntax\n      Adds the specified element to this set if it is not already present. \n     More formally, adds the specified element e to this set if this set ,\n     contains no element e2 such that Objects.equals(e, e2). \n     If this set already contains the element, the call leaves \n     the set unchanged and returns false.     \n````\n\n    \n    \n\u003cli\u003e \u003ch3\u003e 2. Remove \u003c/h3\u003e \u003c/li\u003e\n   \u003cul\u003e\n     \u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo1.java\" \u003e HashSet [Remove]\u003c/a\u003e\u003c/h3\u003e\n    \u003c/ul\u003e\n    \n```Syntax\n      Removes the specified element from this set if it is present. \n      More formally, removes an element e such that Objects.equals(o, e), \n      if this set contains such an element. \n      Returns true if this set contained the element.     \n````\n\n\u003cli\u003e \u003ch3\u003e 3. Clear \u003c/h3\u003e \u003c/li\u003e\n   \u003cul\u003e\n     \u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo2.java\" \u003e HashSet [Clear]\u003c/a\u003e\u003c/h3\u003e\n    \u003c/ul\u003e\n \n ```Syntax\n      Removes all of the elements from this set. \n      The set will be empty after this call returns. \n````\n    \n   \u003cli\u003e \u003ch3\u003e 4. Clone \u003c/h3\u003e \u003c/li\u003e\n   \u003cul\u003e\n     \u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo3.java\" \u003e HashSet [Clone]\u003c/a\u003e\u003c/h3\u003e\n    \u003c/ul\u003e\n    \n```Syntax\n      Returns a shallow copy of this HashSet instance: the elements themselves are not cloned.\n````    \n    \n\u003cli\u003e \u003ch3\u003e 5. Iterator \u003c/h3\u003e \u003c/li\u003e\n   \u003cul\u003e\n     \u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo4.java\" \u003e HashSet [Iterator]\u003c/a\u003e\u003c/h3\u003e\n     \u003cul\u003e\n     \n```Syntax\n      Iterator: It iterates over the elements in the set. \n      The elements are returned in no particular order.\n      \n      Note: The double colon (::) operator, \n      also known as method reference operator.\n      \n      →Double Colon Operator is used to call a method,\n      by referring to it with the help of its class directly.\n````\n\n\u003cli\u003e\u003ch3\u003ea. HashSet [Iterator] → For Each Remaining\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003cul\u003e\n        \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo5.java\" \u003e For Each Remaining\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003c/ul\u003e\n     \n```Syntax\n     Performs the given action for each remaining element,\n     until all elements have been processed or\n     the action throws an exception. Actions are performed,\n     in the order of iteration, if that order is specified. \n     Exceptions thrown by the action are relayed to the caller.\n````\n\n\u003cli\u003e\u003ch3\u003eb. HashSet [Iterator] → hasNext\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003cul\u003e\n        \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo6.java\" \u003e hasNext\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003c/ul\u003e\n     \n```Syntax\n    Returns true if the iteration has more elements. \n    (In other words, returns true if next would return ,\n    an element rather than throwing an exception.)\n```` \n\n\u003cli\u003e\u003ch3\u003ec. HashSet [Iterator] →Next\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003cul\u003e\n        \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo7.java\" \u003e Next\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n       \u003cul\u003e\n       \n```Syntax\n   Returns the next element in the iteration.\n````\n\n\u003cli\u003e\u003ch3\u003eNext.CompareTo\u003c/h3\u003e\u003c/li\u003e\n         \u003cul\u003e\n           \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo9.java\" \u003eNext.CompareTo\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n         \u003c/ul\u003e\n         \n```Syntax\n  Compares two Integer objects numerically.\n````\n\n\u003c/ul\u003e\n\u003c/ul\u003e\n     \n\n\u003cli\u003e\u003ch3\u003ed. HashSet [Iterator] →remove\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003cul\u003e\n        \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo8.java\" \u003e Remove\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n     \u003c/ul\u003e\n     \n```Syntax\n  Removes from the underlying collection the last element,\n  returned by this iterator (optional operation).\n  This method can be called only once per call to next.\n````\n\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e6. HashSet →[Union]AddAll\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo10.java\" \u003e [Union]AddAll\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n Adds all of the elements in the specified collection to this ,\n set if they're not already present (optional operation). \n If the specified collection is also a set, the addAll operation,\n effectively modifies this set so that its value is the union of the two sets. \n The behavior of this operation is undefined,\n if the specified collection is modified while the operation is in progress.\n````\n\n\u003cli\u003e\u003ch3\u003e7. HashSet →[Intersection]RetainAll\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo11.java\" \u003e [Intersection]RetainAll\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n Retains only the elements in this collection that are contained,\n in the specified collection (optional operation)[Intersection]. In other words, \n removes from this collection all of its elements that are not ,\n contained in the specified collection.\n````\n\n\u003cli\u003e\u003ch3\u003e8. HashSet →Spliterator\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo12.java\" \u003e Spliterator\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n Returns a Spliterator over the elements in this set.\n Creates a late-binding and fail-fast Spliterator,\n over the elements in this set.A late-binding Spliterator,\n binds to the source of elements means HashSet,\n at the point of first traversal, first split,\n or first query for estimated size, \n rather than at the time the Spliterator is created.\n ````\n\u003cli\u003e\u003ch3\u003e9. HashSet →Contains\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo13.java\" \u003e Contains\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n Returns true if this set contains the specified element. \n More formally, returns true if and only if this set contains,\n an element e such that Objects.equals(o, e).\n ````\n \n\u003cli\u003e\u003ch3\u003e10. HashSet →Size\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo20.java\" \u003e Size\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n Returns the number of elements in this set (its cardinality).\n ````\n\n\u003cli\u003e\u003ch3\u003e11. HashSet →isEmpty\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo21.java\" \u003eisEmpty\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n Returns true if this set contains no elements.\n ````\n\n\u003ch2\u003e  \u003c/h2\u003e\n\n\u003cli\u003e\u003ch3\u003e12. HashSet →ContainsAll\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo14.java\" \u003e ContainsAll\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\nFrom: java.util.AbstractCollection \n\nDef: Returns true if this collection contains all of the elements,\nin the specified collection.\n\n````\n\n\n\u003cli\u003e\u003ch3\u003e13. HashSet →RemoveAll\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15.java\" \u003e RemoveAll\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.AbstractSet\n\nDef: Removes from this set all of its elements ,\nthat are contained in the specified collection (optional operation). \nIf the specified collection is also a set, this operation effectively modifies,\nthis set so that its value is the asymmetric set difference of the two sets.\n\nThis implementation determines which is the smaller of this set and the specified collection, \nby invoking the size method on each. If this set has fewer elements, then the implementation ,\niterates over this set, checking each element returned by the iterator,\nin turn to see if it is contained in the specified collection.\n\n\n````\n\n\u003cli\u003e\u003ch3\u003e14. HashSet →RemoveIf\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo16.java\" \u003e RemoveIf\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.Collection\n\nDef: Removes all of the elements of this collection that satisfy the given predicate. \nErrors or runtime exceptions thrown during iteration or ,\nby the predicate are relayed to the caller.\n\n\n````\n\n\u003cli\u003e\u003ch3\u003e15. HashSet →Stream\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo17.java\" \u003e Stream\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n  \n\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.Collection\n\nDef: Returns a sequential Stream with this collection as its source.\n\n````\n\u003cul\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e1. flatMapToDouble/Long/Int\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15a.java\" \u003e flatMapToDouble/Long/Int\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e2. mapToDouble/Long/Int\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15aa.java\" \u003e mapToDouble/Long/Int\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e3. collect(Collectors.toMap())\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15b.java\" \u003ecollect(Collectors.toMap())\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e4. allMatch\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15c.java\" \u003eallMatch\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e5. anyMatch\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15d.java\" \u003eanyMatch\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e6. noneMatch\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15e.java\" \u003enoneMatch\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e7. dropWhile\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15g.java\" \u003edropWhile\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e8. distinct\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15h.java\" \u003edistinct\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e9. spliterator  \u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e9.a. spliterator().hasCharacteristics(Spliterator.ORDERED/DISTINCT/SORTED/SIZED/SUBSIZED/NONNULL/IMMUTABLE/CONCURRENT)  \u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15i.java\" \u003espliterator().hasCharacteristics()\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e9.b. spliterator().tryAdvance()  \u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15f.java\" \u003espliterator().tryAdvance()\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e10. iterator  \u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15j.java\" \u003eiterator\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e11. isParallel \u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15k.java\" \u003eisParallel\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cli\u003e\u003ch3\u003e12. findFirst \u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15l.java\" \u003efindFirst\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cli\u003e\u003ch3\u003e13. filter\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo15m.java\" \u003efilter\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003cli\u003e\u003ch3\u003e16. HashSet →ParallelStream\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo18.java\" \u003e ParallelStream\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\n\n\n```Syntax\n\nFrom: java.util.Collection\n\nDef: Returns a possibly parallel Stream with this collection as its source. \nIt is allowable for this method to return a sequential stream.\n\n````\n\u003ch3\u003e \u003ci\u003e\u003cins\u003eNote\u003c/ins\u003e:Parallel Stream has similar functions like Streams. \u003c/i\u003e\u003c/h3\u003e \n\n\u003cli\u003e\u003ch3\u003e17. HashSet →toArray\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo19.java\" \u003e toArray\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.Collection\n\nDef: Returns an array containing all of the elements in this collection; \nthe runtime type of the returned array is that of the specified array. \nIf the collection fits in the specified array, it is returned therein. \nOtherwise, a new array is allocated with the runtime type of the specified array \nand the size of this collection.\n\n````\n\n\u003cli\u003e\u003ch3\u003e18. HashSet →equals\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo22.java\" \u003e Equals\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.AbstractSet\n\nDef: Compares the specified object with this set for equality. \nReturns true if the given object is also a set, \nthe two sets have the same size, \nand every member of the given set is contained in this set. \n\n````\n\n\u003cli\u003e\u003ch3\u003e19. HashSet →toString\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo23.java\" \u003e toString\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.AbstractCollection\n\nDef: Converts the set to string and returns the collection.\n\n````\n\n\u003cli\u003e\u003ch3\u003e19. HashSet →hashCode\u003c/h3\u003e\u003c/li\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/HashSetDemo24.java\" \u003e HashCode\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n```Syntax\n\nFrom: java.util.AbstractSet\n\nDef: Returns the hash code value for this set. \nThe hash code of a set is,\ndefined to be the sum of the hash codes of the elements in the set, \nwhere the hash code of a null element is defined to be zero. \n\n````\n\n\u003ch2\u003e  \u003c/h2\u003e\n\n\u003c/ul\u003e\n    \n```mermaid\n\nsequenceDiagram\n    \n  \n  java.lang.Object-\u003e\u003ejava.util.AbstractCollection: \n  java.util.AbstractCollection-\u003e\u003ejava.util.AbstractSet: \n  java.util.AbstractSet-\u003e\u003ejava.util.HashSet: \n```\n\n\u003ch1\u003eAbstract Set \u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/AbstractSetDemo.java\" \u003e AbstractSet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n We can create instance of HashSet from Abstract Set.\n AbstractSet class in Java is a part of the Java Collection Framework,\n which implements the Collection interface and extends,\n the AbstractCollection class. It provides a skeletal implementation,\n of the Set interface. \n ````\n \n\u003c/ul\u003e\n\n\n\u003ch1\u003eAbstract Collection \u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/AbstractCollectionDemo.java\" \u003e Abstract Collection\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n We can create instance of HashSet from Abstract Collection.\n The AbstractCollection class in Java is a part of the ,\n Java Collection Framework and implements the Collection interface. \n It is used to implement an unmodifiable collection, \n for which one needs to only extend this AbstractCollection Class \n and implement only the iterator and the size methods. \n ````\n \n\u003c/ul\u003e\n\n\u003ch1\u003eObject[java.lang.Object] \u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ObjectSetDemo.java\" \u003e Object[java.lang.Object]-1\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ObjectSetDemo1.java\" \u003e Object[java.lang.Object]-2\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n We can create instance of HashSet from Object → [java.lang.Object].\n ````\n \n\u003c/ul\u003e\n\n\n  \u003c/ul\u003e\n\u003c/ul\u003e\n\n\u003c/h3\u003e\n\u003ch1 align=\"center\"\u003e  TreeSet Functionality:  \u003c/h1\u003e\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.lang.Object-\u003e\u003ejava.util.AbstractCollection: \n  java.util.AbstractCollection-\u003e\u003ejava.util.AbstractSet: \n  java.util.AbstractSet-\u003e\u003ejava.util.TreeSet: \n```\n\u003ch3\u003e Def: Java TreeSet class implements the Set interface that uses a tree for storage. It inherits AbstractSet class and implements the NavigableSet interface and SortedSet interface. The objects of the TreeSet class are stored in ascending order. \u003c/h3\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth\u003eInterface\u003c/th\u003e\n    \u003cth\u003eHash Table\u003c/th\u003e\n    \u003cth\u003eResizable Array\u003c/th\u003e \n   \u003cth\u003eBalanced Tree\u003c/th\u003e \n   \u003cth\u003eLinked List\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd \u003eSet\u003c/td\u003e\n  \u003ctd \u003eHashSet\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeSet\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n \u003ctd \u003eNavigableSet\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeSet\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tr\u003e\n \u003ctd \u003eSortedSet\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003e\u003c/td\u003e \n  \u003ctd \u003eTreeSet\u003c/td\u003e\n  \u003ctd \u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e  \n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo1.java\" \u003e NavigableSet→TreeSet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo2.java\" \u003e Set→TreeSet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo3.java\" \u003eSortedSet→TreeSet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e Continuing...: Java TreeSet class implements most of the functions that Hash Set uses as given below: \u003c/h3\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo.java\" \u003e Tree Set Functions-1(From HashSet)\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch3\u003e Continuing...: As TreeSet implements Set , Navigable Set  and SortedSet interface , hence it uses  functions of Set , NavigableSet and SortedSet interface. \u003c/h3\u003e\n\n\u003ch3\u003e\u003ci\u003e\u003cins\u003e Extras\u003cins\u003e\u003c/i\u003e \u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo4.java\" \u003eCeiling\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n  \n```Syntax\n It takes Float value in the Function.\n Returns the least element in this set greater than or equal to the given element, \n or null if there is no such element. \n It returns the Ceil value of the Float Value ,entered in the ceiling function.\n ````\n \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo5.java\" \u003eFloor\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n It takes Float value in the Function.\n Returns the greatest element in this set less than or equal to the given element, \n or null if there is no such element. \n It returns the Floor value of the Float Value ,entered in the Floor function.\n ````\n \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo13.java\" \u003eHigher And Lower\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n It takes Float value in the Function.\n \n :Higher:\n ----------------\n Higher Func: Returns the greatest element in the Set corresponding to the number set in Higher Function.\n Where, the number set in the Function must be present in the given set.\n Set: [50.58 , 20.78, 30.65, 10.78, 50.98, 60.65,30.65]\n Higher: set.higher(30.65) = 50.58\n \n \n :Lower:\n ----------------\n Lower Func: Returns the lowest element in the Set corresponding to the number set in Lower Function.\n Where, the number set in the Function must be present in the given set.\n Set: [50.58 , 20.78, 30.65, 10.78, 50.98, 60.65,30.65]\n Lower: set.lower(30.65) = 20.78\n \n ````\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo14.java\" \u003eDescending Iterator\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n \n Descending Iterator: Returns an iterator over the elements in this set in descending order.\n It has all functions like it have in Iterator i.e. CompareTo, Next , hasNext . \n \n ````\n  \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo15.java\" \u003eFirst And Last\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n  \n  ```Syntax\n \n First: Returns first (lowest)element in the set.\n  i.e. set = [2,3,4,1,5,6] , then it will return 1.\n \n Last: Returns last (highest)element in the set.\n i.e. set = [2,3,4,1,5,7,6] , then it will return 7.\n ````\n  \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo16.java\" \u003ePoll First And Poll Last\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n  \n  ```Syntax\n \n Poll First: Retrieves and removes the first (lowest) element, or returns null if this set is empty.\n  i.e. set = [2,3,4,1,5,6] , then it will return 1.\n  And set will be : [2,3,4,5,6]\n \n Poll Last: Retrieves and removes the last (highest) element, or returns null if this set is empty.\n i.e. set = [2,3,4,1,5,7,6] , then it will return 7.\n   And set will be : [2,3,4,1,5,6]\n ````\n \n \u003ch2\u003e \u003c/h2\u003e\n \u003ch2\u003e \u003c/h2\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo6.java\" \u003eSub Set[Sorted Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n Implemented From : java.util.SortedSet\n It returns Sub Set i.e. From a Starting Element to the Last Element.\n i.e. if Set = [1,2,3,4,5,6];\n And Subset :→ From Element : 2 \n And To Element: 6\n IT will return set: [3,4,5]\n ````\n \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo7.java\" \u003eSub Set[Navigable Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n Implemented From : java.util.NavigableSet\n It returns Sub Set i.e. From a Starting Element to the Last Element.\n i.e. if Set = [1,2,3,4,5,6];\n And Subset :→ From Element : 2 , boolean fromInclusive : true\n And To Element: 6 ,  boolean toInclusive : false\n IT will return set: [2,3,4,5]\n \n Similarly:\n \nSubset :→ From Element : 2 , boolean fromInclusive : false\nAnd To Element: 6 , boolean toInclusive : false\nIT will return set: [3,4,5]\n \n ````\n \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo9.java\" \u003eTail Set[Sorted Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n Implemented From : java.util.SortedSet\n It returns Set from a Starting Element set to TailSet function.\n i.e. if Set = [1,2,3,4,5,6];\n And tailset :→ From Element : 2 \n IT will return set: [2,3,4,5,6]\n ````\n \n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo10.java\" \u003eHead Set[Sorted Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n Implemented From : java.util.SortedSet\n It returns Set upto a Ending Element but not the Ending Element set to HeadSet function.\n i.e. if Set = [1,2,3,4,5,6];\n And To Element: 6 ,\n IT will return set: [1,2,3,4,5]\n \n ````\n \n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo11.java\" \u003eTail Set[Navigable Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\n Implemented From : java.util.NavigableSet\n It returns Set from a Starting Element set to TailSet function if Boolean Inclusive set to True,\n Else returns Set from a Starting Element set to TailSet function except the Starting Element ,\n if Boolean Inclusive set to False.\n \n i.e. if Set = [1,2,3,4,5,6];\n And tailset :→ From Element : 2\n And inclusive : true\n IT will return set: [2,3,4,5,6]\n \n Else:\n \n tailset :→ From Element : 2\n And inclusive : false\n IT will return set: [3,4,5,6]\n \n ````\n \n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo12.java\" \u003eHead Set[Navigable Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \n ```Syntax\nImplemented From : java.util.NavigableSet\n It returns Set upto a Ending Element but not the Ending Element set to HeadSet function,\n if Boolean Inclusive set to True,\n Else It returns Set upto a Ending Element with the Ending Element set to HeadSet function,\n if Boolean Inclusive set to False.\n \n i.e. if Set = [1,2,3,4,5,6];\n And HeadSet :→ To Element : 6\n And inclusive : True\n IT will return set: [1,2,3,4,5]\n \n Else:\n \n tailset :→ To Element : 6\n And inclusive : false\n IT will return set: [1,2,3,4,5,6]\n \n ````\n \n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo16.java\" \u003eDescending Set[Navigable Set Interface]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n  \n```Syntax\nImplemented From : java.util.NavigableSet\n\nIt makes the output of Set in Descending Order i.e. From ,\nGreatest Element to Lowest Element. \n \n````\n  \u003ch2\u003e \u003c/h2\u003e \n   \u003ch2\u003e \u003c/h2\u003e\n\u003c/ul\u003e\n\u003ch1 align=\"center\"\u003e  Comparator Interface on Tree Set  \u003c/h1\u003e\n\u003cul\u003e\n\u003ch3\u003e Comparator helps to find the sorting order used in the TreeSet objects ; for example, with the implementation of the Comparator interface.The methods provided by the interface are: \u003c/h3\u003e\n\n\u003ctable\u003e\n\u003ctr\u003e\n  \u003ctd colspan=\"2\"\u003eMethods of the Comparator interface\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n \u003ctd \u003eMethod\u003c/td\u003e\n \u003ctd \u003eDoes This\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n \u003ctd \u003eint compare(Object obj1,Object obj2) \u003c/td\u003e\n \u003ctd \u003eIt compares its two arguments.\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n \u003ctd \u003eboolean equals(Object obj) \u003c/td\u003e\n \u003ctd \u003eIt specifies whether another object is equal to this comparator.\u003c/td\u003e \n\u003c/tr\u003e\n\u003c/table\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/TreeSetDemo17.java\" \u003eComparator Interface on Tree Set[Example]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"center\"\u003e  LinkedHashSet \u003c/h1\u003e\n  \n\u003ch3\u003eThis class extends HashSet, but adds no members of its own. LinkedHashSet is an ordered and sorted collection of HashSet. LinkedHashSet maintains the insertion order of the elements.It uses a doubly linked list to maintain the insertion order. LinkedHashSet  implement the Set interface like HashSet. \u003c/h3\u003e\n\n```mermaid\n\nsequenceDiagram\n    \n  \n  java.lang.Object-\u003e\u003ejava.util.AbstractCollection: \n  java.util.AbstractCollection-\u003e\u003ejava.util.AbstractSet: \n  java.util.AbstractSet-\u003e\u003ejava.util.HashSet: \n  java.util.HashSet-\u003e\u003ejava.util.LinkedHashSet: extends\n```\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/LinkedHashSetDemo.java\" \u003eHashSet→LinkedHashSet[Example]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003cul\u003e\n\u003ch2 align=\"center\"\u003e  LinkedHashSet Functionality\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/LinkedHashSet1.java\" \u003eLinkedHashSet Functionality[Examples]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch1 align=\"center\"\u003e  About Sorted Set Interface \u003c/h1\u003e\n\u003cul\u003e\n\u003ch3\u003eThe Sorted Set interface Set extends Set and declares the behavior of a set sorted in ascending order. Sorted Set is a generic interface that has this declaration:\n\n \u003ch3 align=\"center\"\u003e\n \n ```Syntax\n \n interface SortedSet\u003cE\u003e\n \n ```\n\n \u003c/h3\u003e\n \n\u003ch3\u003e Here E specifies the type of objects that the Set will hold. \u003c/h3\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eInterface\u003c/th\u003e\n     \u003cth \u003eMethods\u003c/th\u003e\n  \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"5\" \u003eSortedSet\u003c/td\u003e\n  \u003ctd \u003efirst\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n \u003ctd \u003elast\u003c/td\u003e   \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eheadSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003etailSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003esubSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003c/table\u003e  \n\u003c/ul\u003e\n\n\u003ch1 align=\"center\"\u003e  About Navigable Set Interface \u003c/h1\u003e\n\n\u003cul\u003e\n\u003ch3\u003eThe NavigableSet interface extends SortedSet and declares the behavior of a collection that supports the retrieval of elements based on the closest match to a given value or values. NavigableSet is a generic interface that has this declaration : \u003c/h3\u003e\n\n \u003ch3 align=\"center\"\u003e\n \n ```Syntax\n \n interface NavigableSet\u003cE\u003e\n \n ```\n\n \u003c/h3\u003e\n \n\u003ch3\u003e Here E specifies the type of objects that the Set will hold. \u003c/h3\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eInterface\u003c/th\u003e\n     \u003cth \u003eMethods\u003c/th\u003e\n  \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"11\" \u003eNavigableSet\u003c/td\u003e\n  \u003ctd \u003eceiling\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n \u003ctd \u003efloor\u003c/td\u003e   \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003edescendingIterator\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003edescendingSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eheadSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003etailSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003esubSet\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003ehigher\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003elower\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003epollFirst\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003epollLast\u003c/td\u003e \n\u003c/tr\u003e\n\u003c/table\u003e  \n\u003c/ul\u003e\n\u003ch3\u003e \u003ci\u003e\u003cins\u003eNote: \u003c/ins\u003e\u003c/i\u003e Collection , Set, SortedSet, Navigable Set are all interfaces and we cannot create their objects due their abstract nature.  \u003c/h3\u003e\n  \n\u003ch1 align=\"center\"\u003e  About AbstractCollection \u003c/h1\u003e\n  \n\u003cul\u003e\n  \n\u003ch3\u003eThe AbstractCollection class is an Abstract Class provides an implementation of the Collection interface. It is used to implement an unmodifiable collection, for which one needs to only extend this AbstractCollection Class and implement only the iterator and the size methods. \u003c/h3\u003e\n  \n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/AbstractCollectionDemo1.java\" \u003eAbstractCollection[Example]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n  \n ```Syntax\n  \n  abstract class AbstractCollection\u003cE\u003e extends Object implements Collection\u003cE\u003e\n  \n ```\n \u003ch3\u003ewhere E is the type of elements. \u003c/h3\u003e\n \n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eAbstract Class\u003c/th\u003e\n \u003cth \u003eMethods\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"11\" \u003eAbstractCollection\u003c/td\u003e\n  \u003ctd \u003eAdd\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n \u003ctd \u003eAddAll\u003c/td\u003e   \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eClear\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eContains\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eContainsAll\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eisEmpty\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eIterator\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eRemove\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003eSize\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003etoArray\u003c/td\u003e \n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd \u003etoString\u003c/td\u003e \n\u003c/tr\u003e\n\u003c/table\u003e    \n   \n\u003c/ul\u003e\n\u003ch1 align=\"center\"\u003e  About AbstractSet \u003c/h1\u003e\n\n\u003ch3\u003eAbstractSet is an Abstract class in Java is a part of the Java Collection Framework which implements the Collection interface and extends the AbstractCollection class. It provides a skeletal implementation of the Set interface. \u003c/h3\u003e\n\n```Syntax\n  \n  abstract class AbstractSet\u003cE\u003e extends AbstractCollection\u003cE\u003e implements Set\u003cE\u003e\n  \n ```\n \u003ch3\u003eWhere E is the type of elements. \u003c/h3\u003e\n \n \n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eAbstract Class\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"10\" \u003eAbstractSet\u003c/td\u003e\n  \u003ctd \u003eremoveAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \n  \u003ctd \u003eequals\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \n  \u003ctd \u003ehashCode\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003c/table\u003e    \n\n\u003cul\u003e\n\n\u003cul\u003e\n \u003cul\u003e\n \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/AbstractSetDemo1.java\" \u003eAbstractSet[Example]\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \u003c/ul\u003e\n \u003c/ul\u003e\n \n \u003cbr\u003e\n\n```mermaid  \n  \n graph TD;\n    Collection--\u003e|extends| Set;\n    Collection--\u003e|implements| AbstractCollection;\n    Set--\u003e|extends| AbstractSet;\n    Set--\u003e|extends| SortedSet;\n    SortedSet--\u003e|extends| NavigableSet;\n    NavigableSet--\u003e|implements| ConcurrentSkiplistSet;\n    AbstractCollection--\u003e|extends| AbstractSet;\n    AbstractSet--\u003e|extends| CopyOnWriteArraySet;\n    AbstractSet--\u003e|extends| HashSet;\n    HashSet--\u003e|extends| LinkedHashSet;\n    AbstractSet--\u003e|extends| TreeSet;\n    AbstractSet--\u003e|extends| EnumSet;\n    AbstractSet--\u003e|extends| ConcurrentSkiplistSet;\n  \n```\n\n\u003ch3\u003eHence we get three more types : \u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e 1. EnumSet \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 2. CopyOnWriteArraySet \u003c/h3\u003e \u003c/li\u003e\n\u003cli\u003e\u003ch3\u003e 3. ConcurrentSkipListSet \u003c/h3\u003e \u003c/li\u003e\n\u003c/ul\u003e\n    \n\n\u003c/ul\u003e\n\n\u003ch1 align=\"center\"\u003e   EnumSet \u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e A specialized Set implementation for use with enum [Enumeration] types. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e All of the elements in an enum set must come from a single enum type that is specified, explicitly or implicitly, when the set is created. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e It extends AbstractSet class and implements Set Interface in Java. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e EnumSet class is a member of the Java Collections Framework . \u003c/h3\u003e \u003c/li\u003e \n \u003cli\u003e \u003ch3\u003e HashSet and TreeSet can also take the type of ENUM  and add ENUM constants to perform Set operations. \u003c/h3\u003e \u003c/li\u003e \n  \u003cul\u003e\n    \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo.java\" \u003eHashSet, Tree Set and EnumSet\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n \u003c/ul\u003e\n \u003cli\u003e \u003ch3\u003e EnumSet inherits methods from Collection. \u003c/h3\u003e \u003c/li\u003e \n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemoA.java\" \u003eEnumSet→Collection\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n \u003cli\u003e \u003ch3\u003e Enum Set also had its Methods as listed below: \u003c/h3\u003e \u003c/li\u003e  \n  \n  \n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"10\" \u003eEnumSet\u003c/td\u003e\n  \u003ctd \u003eof\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \n  \u003ctd \u003eallOf\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003eclone\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003ecomplementOf\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003ecopyOf\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003erange\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003enoneOf\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003c/table\u003e\n  \n\u003cli\u003e \u003ch3\u003e Examples: \u003c/h3\u003e \u003c/li\u003e \n\u003cul\u003e\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo1.java\" \u003eEnumSet→of\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n\n```Syntax\n  \n  Creates an enum set initially containing the specified elements.\n  \n```\n \n\n \n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo2.java\" \u003eEnumSet→allOf\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n\n\n```Syntax\n  \n  Creates an enum set containing all of the elements in the specified element type.\n  \n ```\n \n \n \n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo3.java\" \u003eEnumSet→clone\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n\n\n```Syntax\n  \n  Returns copy of a set.\n  \n ```\n \n\n \n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo4.java\" \u003eEnumSet→complementOf\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n\n\n```Syntax\n  \nCreates an enum set with the same element type as the specified enum set, \ninitially containing all the elements of this type,\nthat are not contained in the specified set.\n  \n```\n \n\n\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo5.java\" \u003eEnumSet→copyOf\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n  \nCreates an enum set with the same element type,\nas the specified enum set, \ninitially containing the same elements (if any).\n  \n```\n\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo6.java\" \u003eEnumSet→range\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n  \nCreates an enum set initially containing all of the elements,\nin the range defined by the two specified endpoints. \n  \n```\n\n\u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/EnumSetDemo7.java\" \u003eEnumSet→noneOf\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\n```Syntax\n  \nCreates an empty enum set with the specified element type. \n  \n```\n\n\u003c/ul\u003e\n  \n\u003c/ul\u003e\n\n\u003ch1 align=\"center\"\u003e   CopyOnWriteArraySet \u003c/h1\u003e\n\n\u003cul\u003e\n\u003cli\u003e \u003ch3\u003e To use this class, we need to import it from java.util.concurrent package.  \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e CopyOnWriteArraySet is a member of the Java Collections Framework. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e It is a Set that uses an internal CopyOnWriteArrayList for all of its operations. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e  It was introduced in JDK 1.5, we can say that it is a thread-safe  version of Set. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e That is Multiple Threads are able to perform update operations simultaneously but for every update operation, a separate cloned copy is created.  \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e  While one thread iterating the Set, other threads can perform updation. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e  Iterators returned are fail-safe. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e It is synchronized. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e An Iterator of CopyOnWriteArraySet class can perform only read-only and should not perform the deletion, otherwise, we will get Run-time exception UnsupportedOperationException. \u003c/h3\u003e \u003c/li\u003e \n\u003cli\u003e \u003ch3\u003e It is slower compared to HashSet since it is synchronized. \u003c/h3\u003e \u003c/li\u003e \n\n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eCopyOnWriteArraySet\u003c/td\u003e\n  \u003ctd \u003eadd\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \n  \u003ctd \u003eaddAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003eclear\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003econtains\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003econtainsAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003eequals\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003eforEach\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003eisEmpty\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003eiterator\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e remove\u003c/td\u003e \n  \n\u003c/tr\u003e\n\u003ctr\u003e\n  \n  \u003ctd \u003e removeAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e removeIf\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e retainAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003esize\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003espliterator\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003etoArray\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/copyonwritearrayset1.java\" \u003eCopyOnWriteArraySet→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth colspan=\"4\"\u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eCopyOnWriteArraySet\u003c/td\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eAbstractSet\u003c/td\u003e\n  \u003ctd \u003ehashCode\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/copyonwritearrayset3.java\" \u003eCopyOnWriteArraySet→AbstractSet→hashCode\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth colspan=\"4\"\u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eCopyOnWriteArraySet\u003c/td\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eAbstractCollection\u003c/td\u003e\n  \u003ctd \u003etoString\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/copyonwritearrayset4.java\" \u003eCopyOnWriteArraySet→AbstractCollection→toString\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth colspan=\"4\"\u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eCopyOnWriteArraySet\u003c/td\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eCollection\u003c/td\u003e\n  \u003ctd \u003eStream\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n \n  \u003ctd \u003eParallel Stream\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/copyonwritearrayset4.java\" \u003eCopyOnWriteArraySet→Collection→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch1\u003e\u003c/h1\u003e\n\u003ch1 align=\"center\"\u003e   ConcurrentSkipListSet \u003c/h1\u003e\n\u003cul\u003e\n  \u003cli\u003e \u003ch3\u003e The ConcurrentSkipListSet class in Java is a part of the Java Collection Framework .  \u003c/h3\u003e \u003c/li\u003e \n   \u003cli\u003e \u003ch3\u003e The ConcurrentSkipListSet class in Java implements the Collection interface and the AbstractSet class .  \u003c/h3\u003e \u003c/li\u003e \n  \u003cli\u003e \u003ch3\u003eThe ConcurrentSkipListSet class is a scalable concurrent NavigableSet implementation based on a ConcurrentSkipListMap.  \u003c/h3\u003e \u003c/li\u003e \n  \u003cli\u003e \u003ch3\u003e The elements of the ConcurrentSkipListSet are kept sorted according to their natural ordering, or by a Comparator provided at set creation time, depending on which constructor is used.  \u003c/h3\u003e \u003c/li\u003e \n  \n  \u003cli\u003e \u003ch3\u003e The ConcurrentSkipListSet class implements Serializable, Cloneable, Iterable, Collection, NavigableSet, Set, SortedSet interfaces. \u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e \u003ch3\u003e The ConcurrentSkipListSet  does not allow null elements, because null arguments and return values cannot be reliably distinguished from the absence of elements. \u003c/h3\u003e \u003c/li\u003e\n  \u003cli\u003e \u003ch3\u003e The ConcurrentSkipListSet is thread-safe. \u003c/h3\u003e \u003c/li\u003e\n\n\n\u003ch2\u003e \u003c/h2\u003e\n \u003ch2 align= \"center\" \u003e The ConcurrentSkipListSet Methods :  \u003c/h2\u003e \n\n\n   \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"30\" \u003eConcurrentSkipListSet\u003c/td\u003e\n  \u003ctd \u003eadd\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e ceiling\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e floor\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003e clear\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003e clone\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003ecomparator\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003econtains\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003edescendingIterator\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003edescendingSet\u003c/td\u003e \n  \n\u003c/tr\u003e\n     \n\u003ctr\u003e\n  \n  \u003ctd \u003eequals\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003efirst\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \n  \u003ctd \u003elast\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e headSet\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e tailSet\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e higher\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003elower\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003epollFirst\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003epollLast\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e remove\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e removeAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e size\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e spliterator\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e subSet\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n  \n  \u003ctd \u003e isEmpty\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ConcurrentSkipListSet1.java\"\u003eConcurrentSkipListSet→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n  \n  \n \u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth colspan=\"4\"\u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eConcurrentSkipListSet\u003c/td\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eAbstractCollection\u003c/td\u003e\n  \u003ctd \u003eaddAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\u003ctr\u003e\n   \u003ctd \u003econtainsAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n \n\u003ctr\u003e\n   \u003ctd \u003eretainAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\u003ctr\u003e\n   \u003ctd \u003etoArray\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n   \u003ctd \u003etoArray(T[] a)\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n   \u003ctd \u003etoString\u003c/td\u003e \n  \n\u003c/tr\u003e\n  \n  \n\n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ConcurrentSkipListSet2.java\"\u003eConcurrentSkipListSet→AbstractCollection→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth colspan=\"4\"\u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eConcurrentSkipListSet\u003c/td\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eSet\u003c/td\u003e\n  \u003ctd \u003eaddAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\u003ctr\u003e\n   \u003ctd \u003econtainsAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n \n\u003ctr\u003e\n   \u003ctd \u003eretainAll\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\u003ctr\u003e\n   \u003ctd \u003etoArray\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n   \u003ctd \u003etoArray(T[] a)\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n\u003ctr\u003e\n   \u003ctd \u003ehashCode\u003c/td\u003e \n  \n\u003c/tr\u003e\n  \n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ConcurrentSkipListSet3.java\"\u003eConcurrentSkipListSet→Set→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n \u003cth colspan=\"4\"\u003eClass\u003c/th\u003e\n \u003cth colspan=\"4\"\u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eConcurrentSkipListSet\u003c/td\u003e\n  \u003ctd colspan=\"4\" rowspan=\"17\" \u003eCollection\u003c/td\u003e\n  \u003ctd \u003eparallelStream\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\u003ctr\u003e\n   \u003ctd \u003eStream\u003c/td\u003e \n  \n\u003c/tr\u003e\n\n \n\u003ctr\u003e\n   \u003ctd \u003eremoveIf\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n  \n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ConcurrentSkipListSet4.java\" \u003eConcurrentSkipListSet→Collection→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ctable\u003e\n \u003ctr\u003e\n \u003cth \u003eClass\u003c/th\u003e\n \u003cth \u003eInherited From\u003c/th\u003e\n \u003cth \u003eMethod/s\u003c/th\u003e \n\u003c/tr\u003e \n\u003ctr\u003e\n  \u003ctd rowspan=\"2\" \u003eConcurrentSkipListSet\u003c/td\u003e\n  \u003ctd  \u003ejava.lang.Iterable\u003c/td\u003e\n  \n  \u003ctd \u003eIterable\u003c/td\u003e \n  \n\u003c/tr\u003e\n   \n\u003ctr\u003e\n\u003ctd \u003ejava.util.Iterator\u003c/td\u003e \n\u003ctd \u003eforEach\u003c/td\u003e \n\u003c/tr\u003e\n  \n\u003c/table\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch3\u003e\u003ca href= \"https://github.com/AvinandanBose/JavaCollectionFramework/blob/main/ConcurrentSkipListSet5.java\"\u003eConcurrentSkipListSet→Iterable \u0026 Iterator→Methods\u003c/a\u003e\u003c/h3\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/ul\u003e\n\u003ch1\u003e👉\u003ca href= \"https://github.com/AvinandanBose/JavaGeneric\"\u003eSet implemention in Java Generics \u003c/h1\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinandanbose%2Fjava-collection-framework-and-java-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinandanbose%2Fjava-collection-framework-and-java-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinandanbose%2Fjava-collection-framework-and-java-set/lists"}