Ad Home

Theme images by kelvinjay. Powered by Blogger.

Travel

Header Ads

Java

Selenium

UFT

Framework

General QA Concept

BDD

» » » » » » What Is The Difference Between enum,Enum and Enumeration in Java?

Few days back I got this question from one of my blog follower Anish. Thanks for raising this point Anish. I am going publish a little comparison between them what ever I got with the help of Google.


enum

Enum

Enumeration

enum is a keyword which represents a group of named constants

Enum is present in java.lang package. It is a parent class of enum. So it acts as a base class for every enum

Enumeration is an interface present in java.util package

enum can hold constructor(no argumented and argumented) and methods

Enum can not hold the constructor or methods

We use this method to get object from collection one by one

Below 1.4 version it was used as a literal and after 1.4 version it becomes group of constants and it is reserved



«
Next
Newer Post
»
Previous
Older Post

No comments:

Leave a Reply