Two Laptop Bag*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Enums Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Enums" Watch "Enums" New topic
Author

Enums

Akhil Maharaj
Ranch Hand

Joined: Sep 29, 2007
Posts: 63
Hi ,

In the following code If I don't put semicolon at the end of

EXEC(1.5,150) it is not getting compiled . Accroding to K&B page 65 example , semicolon is required when we have body.Any explanation ?

Code is here .

Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
Not sure what you're asking. That's just the syntax for defining an enum.

The semicolon is needed to denote the end of the enum value list. It's optional if you don't provide any methods or fields, but you can include it too if you want, e.g.:



SCJP 5.0
Akhil Maharaj
Ranch Hand

Joined: Sep 29, 2007
Posts: 63
I read K&B Errata for Page 62 and Page 65 . It did not make much sense to m e. After reading your post , errata for K&B - I currected myself .I think I am clear on enums now .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Enums