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 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 "Enum" Watch "Enum" New topic


Venkat Sidh
Ranch Hand

Joined: Sep 30, 2006
Posts: 61
In the below enum code,

what is the code to print string value Extra Large and invoke age().
Matt Russell
Ranch Hand

Joined: Aug 15, 2006
Posts: 165
Your code will not compile. You need to add, at a minimum, a constructor that accepts a String argument.

Inquisition: open-source mock exam simulator for SCJP and SCWCD
Venkat Sidh
Ranch Hand

Joined: Sep 30, 2006
Posts: 61
Here is the full piece of code,

Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
What have you tried so far?

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

Joined: May 02, 2006
Posts: 218
Use size.description and size.age()

SCJP 5.0 | SCWCD 1.4 <br /> <br />If you don't know where you are going, any road will take you there!
Venkat Sidh
Ranch Hand

Joined: Sep 30, 2006
Posts: 61

I haven't tried that far but in middle I saw few questions online about Enum's, I gave a try and stuck on this particular question.

First of all I shouldn't have tried mock-up questions until I finish studying.

Thanks all.
I agree. Here's the link:
subject: Enum
It's not a secret anymore!