enum in java - the java concepts

Enum in java:–

An enum is a special "class" that represents a group of constant ( Unchangeable variable like final variable) 

     To create enum, use the enum keywords (instead of a class or interface), and separate the constants with a comma Note that they should be in uppercase letters:

Enumeration serve the purpose of representing a group of named constants in a programming language. 

     Enums are used when we know all possible value at compile time, such as a choice on a menu, rounding modes, command line flag, etc. It is not necessary that the set of constants in an enums type stay fixed for all. 

                enums are represented using enums data type. Java enums are more powerful than C/C++ enums. In Java we can also add variable, methods and constructors to it. The main objective of enum is to define our data types ( Enumerated Data types )

RELATED LINKS🔗

DECLARATION OF ENUM IN JAVA

IMPORTANT POINT OF ENUM


Comments

Popular posts from this blog

Java & Java Uses - thejavaconceptsparts

Buzzword in Java - thejavaconceptspart

Java Naming Conventions - thejavaconceptspart