This post originated from an RSS feed registered with Java Buzz
by justin cater.
Original Post: How and when to use Enums and Annotations
Feed Title: Java Code Geeks
Feed URL: http://feeds.feedburner.com/JavaCodeGeeks
Feed Description: Java 2 Java Developers Resource Center
In this lesson we will discuss enums (or enumerations) and annotations. The idea of enums is simple, but quite handy: it represents a fixed, constant set of values. What it means in practice is that enums are often used to design the concepts which have a constant set of possible states.
From the other side, annotations are a special kind of metadata which could be associated with different elements and constructs of the Java language. Interestingly, annotations have contributed a lot into the elimination of boilerplate XML descriptors used in Java ecosystem mostly everywhere. They introduced the new, type-safe and robust way of configuration and customization techniques.