• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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.
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic