![]() |
VOOZH | about |
New_Enum_Set = EnumSet.copyOf(Collection collect)Parameters: The method accepts one parameter collect of the object type of the enum and refers to the collection whose values are to be copied into the New_Enum_Set. Return Values: The method does not return any values. Exceptions:
The collection is: [Welcome, World, Geeks] The enum set is:[Welcome, World, Geeks]
New_Enum_Set = EnumSet.copyOf(EnumSet e_set)Parameters: The method accepts one parameter e_set of the object type of the enum and refers to the set whose values are to be copied into the New_Enum_Set. Return Values: The method does not return any values. Exceptions: The method throws NullPointerException when e_set is NULL. Below program illustrates the working of java.util.EnumSet.copyOf() method:
Initial set is: [RANGE_ROVER, MUSTANG, CAMARO, AUDI, BMW] The new set is: [RANGE_ROVER, MUSTANG, CAMARO, AUDI, BMW]