- Java.util - WeakHashMap
- Java.util - Vector
- Java.util - UUID
- Java.util - TreeSet
- Java.util - TreeMap
- Java.util - TimeZone
- Java.util - TimerTask
- Java.util - Timer
- Java.util - StringTokenizer
- Java.util - Stack
- Java.util - SimpleTimeZone
- Java.util - ServiceLoader
- Java.util - Scanner
- Java.util - ResourceBundle.Control
- Java.util - ResourceBundle
- Java.util - Random
- Java.util - PropertyResourceBundle
- Java.util - PropertyPermission
- Java.util - Properties
- Java.util - PriorityQueue
- Java.util - Observable
- Java.util - Locale
- Java.util - ListResourceBundle
- Java.util - LinkedList
- Java.util - LinkedHashSet
- Java.util - LinkedHashMap
- Java.util - IdentityHashMap
- Java.util - Hashtable
- Java.util - HashSet
- Java.util - HashMap
- Java.util - GregorianCalendar
- Java.util - Formatter
- Java.util - EnumSet
- Java.util - EnumMap
- Java.util - Dictionary
- Java.util - Date
- Java.util - Currency
- Java.util - Collections
- Java.util - Calendar
- Java.util - BitSet
- Java.util - Arrays
- Java.util - ArrayList
- Java.util - ArrayDeque
- Java.util - Home
Java.util Package Extras
- Java.util - Discussion
- Java.util - Useful Resources
- Java.util - Enumerations
- Java.util - Exceptions
- Java.util - Interfaces
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.util.EnumSet Class
Introduction
The java.util.EnumSet class is a speciapzed Set implementation for use with enum types.Following are the important points about EnumSet −
All of the elements in an enum set must come from a single enum type that is specified, exppcitly or imppcitly, when the set is created.
Enum sets are represented internally as bit vectors.
EnumSet is not synchronized.If multiple threads access an enum set concurrently, and at least one of the threads modifies the set, it should be synchronized externally.
Class declaration
Following is the declaration for java.util.EnumSet class −
pubpc abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> implements Cloneable, Seriapzable
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method creates an enum set containing all of the elements in the specified element type. |
2 | This method returns a copy of this set. |
3 | This method creates an enum set with the same element type as the specified enum set, initially containing all the elements of this type that are not contained in the specified set. |
4 | This method creates an enum set initiapzed from the specified collection. |
5 | This method creates an enum set with the same element type as the specified enum set, initially containing the same elements (if any). |
6 | This method creates an empty enum set with the specified element type. |
7 | This method creates an enum set initially containing the specified element. |
8 | This method creates an enum set initially containing the specified elements. |
9 | This method creates an enum set initially containing the specified elements. |
10 | This method creates an enum set initially containing the specified elements. |
11 | This method creates an enum set initially containing the specified elements. |
12 | This method creates an enum set initially containing the specified elements. |
13 | This method creates an enum set initially containing all of the elements in the range defined by the two specified endpoints. |
Methods inherited
This class inherits methods from the following classes −
java.util.AbstractSet
java.util.AbstractCollection
java.util.Object
java.util.Set