posted 24 years ago
Best way to check these is with some code. So that is what I wrote up for you.
Let me give you the answers to what I found, and then I would copy the code and play with it to see what you get.
1. You don't really inherit innerclasses becuase in order to access the innerclass you have to have an instance of it. But as the code below shows, if you have an instance of the sub class, you can use that instance to create an instance of the inner class.
2. Run Sub.java after you compile this and you will see that you get Parents main method, so yes you do inherit the main method.
3. After you run the code below you will see that the Parent's constrctor is called and then the Sub's, but not the inner class. Inner classes are just like other classes and constructors are not called untile you instantiate it.
Hope this helps,
Bill