classpath
[Top][All Lists]
Advanced

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

Re: java.lang.Class inner class methods


From: reali
Subject: Re: java.lang.Class inner class methods
Date: Thu, 2 Aug 2001 11:22:54 +0200 (MET DST)

> 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.

The inner class "Y" of class "X" is compiled as "X$Y".
So if a class name contains "$", it must be an innerclass.


This is documentend in the Innerclass specification,
http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc.html
in section "Class Name Transformation"
http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc7.html

-Patrik



--
Patrik Reali, address@hidden
http://www.inf.ethz.ch/personal/reali/
http://www.oberon.ethz.ch/native/




reply via email to

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