The Artima Developer Community
Sponsored Link

Java Buzz Forum
What Java developer Should know about Enumeration Type in Java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
What Java developer Should know about Enumeration Type in Java Posted: Apr 23, 2014 9:08 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: What Java developer Should know about Enumeration Type in Java
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
Apart from Class and Interface, Enumeration type or Enum is another popular type in Java programming language. Enum allows you to represent fixed number of things in a type-safe manner e.g. days of week, days of month, planets in solar system, buttons on remote control, keys on keyboard and suits on playing cards. Before Enum was introduced, prior to Java 1.5, integer and string constants are used to represent fixed number of things, known as enum int pattern and enum string pattern. Though they serve the purpose, they had some major drawbacks, one of them was type-safety i.e. you cannot restrict them to represent fixed number of values  e.g. an integer constant, which is representing days of week can have value as 100, which is incorrect, given we have only 7 days in a week. These limitation are addressed by providing enum type, which guarantees that only correct and fixed number of values can be assigned to them. Good thing about Enum in Java is that they are feature rich, bad thing is that they are still under-used and many developers doesn't even know about Enumeration type in detail. Though there are lot of blog post about different features of Enum in Java, and there usage, there is hardly any page, which provides a good look on key points about Enum. It doesn't mean to be comprehensive but at-least provides those lesser known details. I had previously shared some features in form of question answer on my article 15 Java Enum Interview Questions and in this post we will learn more about Enum in Java, it's more like a summary and notes than a tutorial, which is meant to quickly realize power of Enumeration type in Java.
Read more »

Read: What Java developer Should know about Enumeration Type in Java

Topic: IntelliJ IDEA 13.1.2 Update is Available Previous Topic   Next Topic Topic: How can I do This? – With SQL of Course!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use