This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes enum Hierarchy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "enum Hierarchy" Watch "enum Hierarchy" New topic

enum Hierarchy

susan waters
Ranch Hand

Joined: Feb 21, 2006
Posts: 68
Too many questions on enums right ?

Is there any hierarchy that we should follow when we declare an enum ?


1. enum should first like Constants
2. enum next should have constructors
3. Next member variables declarations
4. next methods ?

I can try compiling bu putting all these pieces but just thought of asking this...thanks
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
enum constant should come first. Order of 2,3 and 4 does not matter.

Too many questions on enums right ?

Hope you got all your replies.

[ July 27, 2006: Message edited by: Naseem Khan ]

Asking Smart Questions FAQ - How To Put Your Code In Code Tags
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: enum Hierarchy
It's not a secret anymore!