Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Enumeration in java ?

View previous topic View next topic Go down

GMT + 3 Hours Enumeration in java ?

Post by Diya Sun May 29, 2011 3:01 pm

Dear sir, please sir guide me that how enumeration is done in java??
for example that we want to the names of months and constrain a person not to selected name or phrase other that the name of the month.
for this method what should we do???
Diya
Diya
Monstars
Monstars

Taurus Goat
Posts : 364
Join date : 2011-02-08
Age : 32
Notworthy

Character sheet
Experience:
Enumeration in java ? Left_bar_bleue10/500Enumeration in java ? Empty_bar_bleue  (10/500)

Back to top Go down

GMT + 3 Hours Re: Enumeration in java ?

Post by Vuhelper Sun May 29, 2011 3:01 pm

An enum type is a type whose fields consist of a fixed set of constants. Common examples include compass directions (values of NORTH, SOUTH, EAST, and WEST) and the days of the week.

Because they are constants, the names of an enum type's fields are in uppercase letters.

In the Java programming language, you define an enum type by using the enum keyword. For example, you would specify a days-of-the-week enum type as:

public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY
}

Note: for further details following web link can help you
[You must be registered and logged in to see this link.]
avatar
Vuhelper
Deep Bench
Deep Bench

Posts : 97
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum