Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ENUM the real ghost arrives..

 
deepesh mathur
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all Ranchers,
i just want to ask that:
1.what for this enum is made?
2.what does one mean by "CONSTANT SPECIFIC CLASS BODY"
kindly explain in detail whatever you know please and thanks in advance..
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepesh mathur:
...1.what for this enum is made?...

I'm sorry, I'm not sure what you're asking here. For a general overview of what enums are, and what they're for, see this article: Enums
Originally posted by deepesh mathur:
...2.what does one mean by "CONSTANT SPECIFIC CLASS BODY"...

It means that you can create a class body for each enum constant. See the example at the end of JLS 8.9 Enums.
 
deepesh mathur
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir ,
i think you've misunderstood ENUM is a keyword in java (added in 5.0 only)
and same is for that CONSTANT SPECIFIC CLASS BODY i need that specification
and by the way thanks...
 
Henry Wong
author
Marshal
Pie
Posts: 20889
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepesh mathur:
hello sir ,
i think you've misunderstood ENUM is a keyword in java (added in 5.0 only)
and same is for that CONSTANT SPECIFIC CLASS BODY i need that specification
and by the way thanks...


There is a new keyword "CONSTANT SPECIFIC CLASS BODY"? Where did you read this?

Henry
 
Kelvin Chenhao Lim
Ranch Hand
Posts: 513
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by deepesh mathur:
hi all Ranchers,
i just want to ask that:
1.what for this enum is made?
2.what does one mean by "CONSTANT SPECIFIC CLASS BODY"
kindly explain in detail whatever you know please and thanks in advance..

Hi Deepesh,

Marc already provided you with some good links explaining the concepts you asked about. If you have a more specific query, it's best that you explain your own current understanding and then list the concepts you're unsure about. It takes a lot of effort to "explain in detail whatever you know" (after all, people even get paid to write books on these things!), and most of us are just volunteers here--so you'll get more and better responses if you take a few minutes to pose more specific questions.

All the best!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic