Originally posted by sanjeevmehra mehra:
enum (enumeration) is an interface and interfaces do not extend from Object class.
thanks & regards,
I am talking about enums in java Tiger and not Enumeration interface.
Originally posted by Pradeep Bhat:
Do enums extend java.lang.Object?
Sure, all class MUST extends java.lang.Object.
public abstract class Enum<E extends Enum<E>>extends Objectimplements Comparable<E>, SerializableThis is the common base class of all Java language enumeration types.
This flexible object-oriented enumerated type facility allows you to create enumerated types with arbitrary methods and fields. It provides all the benefits of the Typesafe Enum pattern ("Effective Java," Item 21) without the verbosity and the error-proneness. Refer to JSR 201.