Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

from Enum

 
Nishant Arora
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class as
enum CheckEnum{ } i have compiled it.
then i disassembled it using javap command , i got

final class CheckEnum extends java.lang.Enum{
--------------------;
--------------------;
static{ };
}

Can anyone explain in detail why this static dispalyed here?
thanks.
 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I decompiled that class using JAD, and this is the output:
I can match valueOf and values, so that static block probably matches the creation of the array.

As for the confirmation, I added one single enum value, and JAD now produces this:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic