Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

The Enumeration List are: 
JAVA
JSP
SERVLET
C
PHP
PERL

Example 2

Test it Now

Output:

The Enumeration List are: 
1100
2100
5100

Example 3

Test it Now

Output:

Elements using Enumeration: 101 Hello World true 101.5 






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA