EnumSet and TreeSet both are the classes defined inside the collection framework. But there are few differences exists between them. In this article, we have… Read More
Tag Archives: java-EnumSet
EnumMap and EnumSet both are the classes defined inside the java collection. In this article, we will learn the differences between EnumMap and EnumSet. EnumMap… Read More
The java.util.EnumSet.of(E ele1, E ele2, E ele3, …) method in Java is used to create an enum set initially containing the specified elements in the… Read More
The Java.util.EnumSet.clone() method in Java is used to return a shallow copy of the existing or this set. Syntax: Enum_Set_2 = Enum_Set_1.clone() Parameters: The method… Read More
The java.util.EnumSet.complementOf(Enum_Set) method is used to create an EnumSet containing elements of the same type as that of the specified Enum_Set, with the values present… Read More
The Java.util.EnumSet.allOf(Class elementType) in Java is used to create an enum set that will be used to contain all of the elements in the specified… Read More
The java.util.EnumSet.copyOf(Collection collect) method in Java is used to copy all of the contents from a collection to a new enum set. At first, the… Read More
The java.util.EnumSet.noneOf(Class elementType) method in Java is used to create a null set of the type elementType. Syntax: public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E>… Read More
The java.util.EnumSet.range(E start_point, E end_point) method in Java is used to create an enum set with the elements defined by the specified range in the… Read More
Enumerations or popularly known as enum serve the purpose of representing a group of named constants in a programming language. For example, the 4 suits… Read More