What are the specifications for defining access specifier for classes. If I have a top level class with default accesbility then how do I know what accessbility can the inner class defined in it can have? Same goes with interface. I know that we can not define any access specifiers for local classes as they are accessible within the method only. But what about interfaces nested within classes and vice versa. I'm really confused...
posted 9 years ago
This is an example I created because I was not 100% sure as well. It seems the inner class or interface can have any access modifier and still compile.
Edit : Code changed. To extend on this a bit, I also wanted to see scope/instantiation. Test2 will not compile due to interface c being private. [ October 27, 2006: Message edited by: Matthew Gerald ]
-------------------------<br />SCJP 1.4 10/28/2006<br />SCWCD (next on the list!)