0

If I write an enum like below ,

public enum States{
}

IDE is generating .class file States.class in target, same as if I would have written a class named - States

So here , does .class file simply tells me existence of Java byte code for enum type or does it mean that enum is eventually a type of Java Class type?

Sabir Khan
  • 9,826
  • 7
  • 45
  • 98
  • @Tunaki - the question linked by you doesn't answer my question directly.There is this [blog post](http://boyns.blogspot.nl/2008/03/java-15-explained-enum.html) in one of answers which answers my question - **The Direction enum is really a Java class (in this case an inner class within this Enum class example) and it has a static field named EAST. Looking a little closer you can see that the field EAST is also Direction object** . My question is more specific and answers posted here answer it too. – Sabir Khan Jan 28 '16 at 12:25

2 Answers2

0

Yes enum are type of Java Class.

The values of an enum are the only possible instances of this class.

Wael Sakhri
  • 397
  • 1
  • 8
-1

Sure it is. Check it's official documentation.

public abstract class Enum<E extends Enum<E>>
extends Object
implements Comparable<E>, Serializable

This is the common base class of all Java language enumeration types.

Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59