wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes enum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "enum" Watch "enum" New topic
Author

enum

Enkita mody
Ranch Hand

Joined: Aug 06, 2012
Posts: 333


---------- Run ----------
TeaSize = OVERWHELM Size = 20 Code = A

Output completed (0 sec consumed) - Normal Termination

I was expecting code=B ?


OCA7
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4344
    
    8

private methods can't be overridden. Try making getCode() protected, for instance, and see what happens.
Enkita mody
Ranch Hand

Joined: Aug 06, 2012
Posts: 333

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: enum
 
Similar Threads
Convert from enum ordinal/constant to enum type
Strange Enum behaviour?
Enum constructor
Java "enum" : can you use non-consecutive ordinal numbers ?
Enum