[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java.lang.Class inner class methods

From: Jochen Hoenicke
Subject: Re: java.lang.Class inner class methods
Date: Thu, 2 Aug 2001 10:48:12 +0200


On Aug 1, Patrick Doyle wrote:
> Does anyone have a hint as to how the inner class methods of
> java.lang.Class (getDeclaringClass, getClasses, etc.) would be implemented
> by a JVM?  Don't they depend on how the Java compiler implements inner
> classes?  AFAIK the JVM isn't aware of inner classes at all.

There is an attribute "innerClasses" which contains all necessary
information.  It is documented in the JVM specification 2nd edition
(very tersely, though).  For every inner class member of a class there
must be a corresponding entry in the innerClasses attribute, though
there are a lot of other entries.  The entries for inner classes are
easily detectable since their outer class is the current class.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]