This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Hi ranchers, When declaring an enum why is that we have to define the constructor only after defining the enum constants. If we try defining the constructor before the enum constants we get a compile time error. Can someone explain me this. For ex: //Code that throws compile time error
Java requires that Enum constants should be declared first prior any fields , constructor, methods. The constructor automatically creates the constants that are defined at the beginning of the Enum body.