Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

enum Hierarchy

 
susan waters
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too many questions on enums right ?

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

like

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
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Naseem
[ July 27, 2006: Message edited by: Naseem Khan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic