91
Java Collections enumeration() Method
The enumeration() is a method of Java Collections class which is used to get the enumeration over the specified collection.
Syntax
Following is the declaration of enumeration() method:
Parameter
Parameter | Description | Required/Optional |
---|---|---|
c | It is a collections for which enumeration is to be returned. | Required |
Returns
The enumeration() method returns the enumeration over the specified collection.
Exceptions
NA
Compatibility Version
Java 1.5 and above
Example 1
Output:
The Enumeration List are: JAVA JSP SERVLET C PHP PERL
Example 2
Output:
The Enumeration List are: 1100 2100 5100
Example 3
Output:
Elements using Enumeration: 101 Hello World true 101.5
Next TopicJava Collections Class