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

Enum-doubt

joshua antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 117
I have some doubt on enum.
Are the points below correct?

1.. Enum cannot extend a class but can implement an interface.

2.. we cannot extend or implement enum

3.. Enum are implicitly final(i doubt but i read somewhere)

Any link regarding enum will be helpful
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
Have some collected links for SCJP.
Anupama Ponnapalli
Ranch Hand

Joined: Jun 12, 2006
Posts: 66
Hi,

Here's a link to a tutorial on enums in pdf format:

http://www.oreilly.com/catalog/javaadn/chapter/index.html

In short:

1. Enum cannot extend a class but can implement an interface. true

2. we cannot extend or implement enum. true. Because enums are basically classes and when the byte code is generated, they are final. They are not interfaces, so they cannot be implemented.

3. Enums are implicitly final. true.

An interesting note on side: enums declared within class (enums that are not top level classes) are static by default whether use the keyword or not. But enums that are top level classes in their own files are not static, in fact, if you use the static keyword, a compile time error is raised.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enum-doubt
 
Similar Threads
Doubt on Enums
Doubt on Anonymous Classes
Anonymous inner class doubt
Enum constructor Doubt
enum cannot be final or abstract