The java.io.Set.add method is used in Java to add an element to a Set. The Set is a collection that does not allow duplicate elements, and adding an element to a Set will only be successful if the element is not already present in the Set. This method returns a boolean value indicating whether the element was successfully added or not. If the element is already present, the add method will not modify the Set and will return false.
Java Set.add - 30 examples found. These are the top rated real world Java examples of java.io.Set.add extracted from open source projects. You can rate examples to help us improve the quality of examples.