Web Resources  >  Java  >  Working with Enums

Working with Java Enums

Alternate Solution to Consider

Enum Types
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 
}
You should use enum types any time you need to represent a fixed set of constants. That includes natural enum types such as the planets in our solar system and data sets where you know all possible values at compile time—for example, the choices on a menu, command line flags, and so on.

Here is some code that shows you how to use the enum defined above -- Follow this link:Day

Exceptional Customer Service
Click here to see our extensive Alaska Web Designers portfolio! Webdesign companies provide services to many Alaska firms. Choose Alaska Web Designers to serve your company today. All of our Alaska Web Designers are professionally trained and stay current with latest website business techniques. Portfolio
Check out our extensive portfolio!
We specialize in: Web Design, Web Development, E-Commerce Integration, SEO Internet Marketing, Database Design and Software Development!
Click here to see how our Alaska Web Designers do business in Anchorage, Alaska. Good website developers offer clients value, thus making their companies more productive Our Process
Come see how our business works!
Our business process can and will save your company time and money!
We are your #1 Web Design choice in Alaska! Good service for your firm is our mission. Alaska Web Designers are available to serve your business needs. Web Design
Check out our Web design services!
We specialize in Web design. We can improve your company's presence on the Web.
We are your #1 Web Development choice in Alaska! Web Development
We build applications for the Web
We specialize in Web 2.0 application development. Our professional software engineers can make the Web application of your dreams.
Click here to see our e-commerce solutions for your company! Alaska Web Designers should always be providing value to your firm. Choose Alaska Web Designers to make your e-commerce run smoothly. E-Commerce
We can move your business onto the Web!
Let our software engineers optimize your sales potential. With our E-Commerce solutions your company can make sales 24-7!
Click here to see our Internet Marketing solutions and SEO packages! Our Alaska Web Designers are trained in SEO strategies to propel your firm to the top. Let Alaska Web Designers serve your business needs. Internet Marketing
Improve your company's marketability on the Web!
We can create a marketing plan that will improve your search engine ranking and get your company the reputation it deserves!

NWDS Alaska Web Design Company's webdesign offers affordable custom website design. Our full service website design company only hires formally trained website designers. Please contact us today at 907.227.1676 or chowell@nwds-ak.com for your next web site design project.

Web Site Map