Re: inner class and static
- From: "Mike Schilling" <mscottschilling@xxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 23:00:29 GMT
"Matt Humphrey" <matth@xxxxxxxxxxxxxx> wrote in message
news:QcKdnauD-daeiyHZnZ2dnUVZ_s-dnZ2d@xxxxxxxxxxxxxxx
"jim" <jseers@xxxxxxxxx> wrote in message
news:1153161800.679433.165030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I was told that the variable accessed inside a anonymous inner class
needs to be static.
An inner class (whether anonymous or not) may access the instance
variables of the outer class and it can access the local variables of the
method that instantiates it, provided they are final.
Though a *static* inner class can only access static field of its enclosing
class (and can only call static methods of that class); pehshps that's what
the OP was thinking of.
.
- Follow-Ups:
- Re: inner class and static
- From: jim
- Re: inner class and static
- References:
- inner class and static
- From: jim
- Re: inner class and static
- From: Matt Humphrey
- inner class and static
- Prev by Date: Re: inner class and static
- Next by Date: Re: Why not written in Java?
- Previous by thread: Re: inner class and static
- Next by thread: Re: inner class and static
- Index(es):
Relevant Pages
|