File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes question on enum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "question on enum" Watch "question on enum" New topic

question on enum

Rupak Khurana
Ranch Hand

Joined: Mar 01, 2005
Posts: 89
Is there anyway to make the following code compile. The compiler complains about undefined symbol LIGHT, DARK.. If I comment Line 1 and uncomment Line 2, it will compile. But I want Line 1. Any ideas.. tricks...?

[ July 07, 2005: Message edited by: Rupak Khurana ]
[ July 07, 2005: Message edited by: Barry Gaunt ]

SCJP 1.5<br />SCWCD 1.4
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Use shades.LIGHT etc. in your Line 1

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ariel Ortiz
Ranch Hand

Joined: May 14, 2004
Posts: 121
Hi Rupak,

The only thing that was missing was the name of the type before the enummeration value: "shades.LIGHT" instead of just "LIGHT".


I agree. Here's the link:
subject: question on enum
It's not a secret anymore!