wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes from Enum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "from Enum" Watch "from Enum" New topic
Author

from Enum

Nishant Arora
Greenhorn

Joined: Apr 21, 2009
Posts: 16
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

Joined: Oct 27, 2005
Posts: 19556
    
  16

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:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: from Enum
 
Similar Threads
Need help with a small Java project
Java Servlers/Beans and singleton objects
enum doubt
Storing values in enum
enum static methods