[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Classpath] Re: java.lang.Class inner class methods
From: |
Patrick Doyle |
Subject: |
Re: [Classpath] Re: java.lang.Class inner class methods |
Date: |
Thu, 2 Aug 2001 17:23:59 -0400 (EDT) |
On Thu, 2 Aug 2001, C. Scott Ananian wrote:
> On Thu, 2 Aug 2001 address@hidden 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.
> >
> > The inner class "Y" of class "X" is compiled as "X$Y".
> > So if a class name contains "$", it must be an innerclass.
>
> actually, no. '$' is still a valid identifier character, although
> recommended only for machine-generated code. I can name my class 'A$B'
> without having an outer class 'A' at all.
Plus, it wouldn't give you a way to enumerate all of X's inner classes
anyway.
--
Patrick Doyle
address@hidden