In 1.5.0 release the enumeration type has been added. you can create the enumeration like other language C,C++ etc. For example enum days { MON, Tues, Wed, Thu, Fri,SaT,Sun } ; In java enum is not as the other language. In java enum type has some methods. Each enum type contains a static methos values() that returns an array containing all the values of the enum type in the same sequesnce in which they are declared. You can use this method to extract all the value using for-each-loop. import java.util.*; public class EnumDemo { enum Days {MON, TUES, WED, THU, FRI,SAT,SUN } ; //enum type should not be local variable Days days; public void print() { //Iterateing ...
Future driven solutions.