File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Inner classes within inner classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Inner classes within inner classes" Watch "Inner classes within inner classes" New topic

Inner classes within inner classes

Leo Velazquez

Joined: Apr 27, 2006
Posts: 13
If C is a regular(non method local) inner class of B and B is an inner class of A, does C have direct access to A's private fields just as B does?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45251
Have you tried it?
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1710
Hi Leo,

You can match your case with the following code:


I agree. Here's the link:
subject: Inner classes within inner classes
It's not a secret anymore!