>why the syntax is ok,
> In my memory, inner class just can be used by outer class, why it's
> ok to use the private function ?
Inner class is a member of the outer class, so it can access the
private members of the outer class. Inner class is very similar to a
member method(In terms of accessing private members), like method it
can also access private members. So the syntax is accepted.
I would suggest you to read more about inner classes and understand
it. It will clear many of your doubts.
You may refer the following links for further details:
http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html
http://www.javaworld.com/javaworld/javaqa/2000-03/02-qa-innerclass.html
-Sundar
http://heysundar.blogspot.com
Ahan Hsieh - 05 Oct 2007 10:03 GMT
Hi, Sundar :
Thanks your help, I get more understanding.
Regards. Ahan
> >why the syntax is ok,
> > In my memory, inner class just can be used by outer class, why it's
[quoted text clipped - 14 lines]
> -Sundar
> http://heysundar.blogspot.com