Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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: 171
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: 14667

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 8 API documentation
Garlapati Ravi
Ranch Hand

Joined: Mar 05, 2008
Posts: 171
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.
Have you tried LearnNowOnline?
subject: enum clarification