• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

enum compile error

 
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh.. got it.I thought, it should take string literal.
 
Ranch Hand
Posts: 32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Umm, call me an amatuer but your code looks strange from the start. First you declare an interface but never actually implement anything, then you have enumeration declared inside interface. Enum constants (or objects) are implicitly final, so do fields in interfaces, so would you need both? While I don't know if this the right practise, but this post might be useful for both of us. Also you usually access enum constants in a static way: EnumName.Member. There was a similiar post some time ago.
 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Okti Wmcijewski wrote:Umm, call me an amatuer but your code looks strange from the start. First you declare an interface but never actually implement anything, then you have enumeration declared inside interface. Enum constants (or objects) are implicitly final, so do fields in interfaces, so would you need both? While I don't know if this the right practise, but this post might be useful for both of us. Also you usually access enum constants in a static way: EnumName.Member. There was a similiar post some time ago.



Thank you ,i will read those posts.
 
reply
    Bookmark Topic Watch Topic
  • New Topic