This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes enum clarification 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "enum clarification" Watch "enum clarification" New topic

enum clarification

Garlapati Ravi
Ranch Hand

Joined: Mar 05, 2008
Posts: 168
can anyone tell me why "inside enum" is printed thrice ?

Ravi Kumar
SCWCD 5 - 89%, SCJP 1.4 - 90%
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074

There are three enum constants (BIG, HUGE, OVERWHELMING). For each of those, an instance of the enum is made and the constructor is called.

Note: When you copy a question from a book, mock exam or other source, you are required to quote your sources. Please tell us where you copied this from.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Garlapati Ravi
Ranch Hand

Joined: Mar 05, 2008
Posts: 168
oh, yeah lately realised. that was a silly question. Thanks!

I have copied that from my EditPlus editor

These terms(BIG, HUGE, OVERWHELMING and CoffeeSize) i have copied from Kathy and Bert SCJP book.
I agree. Here's the link:
subject: enum clarification
Similar Threads
Enum Problem
Enum Initializers