This content has been marked as final. Show 3 replies
See the 2 commented lines near the end of code. They are written in an attempt to see output from the constructor of inner class. Both give error.
How/when can I see the constructor of inner class executed?
How can I call PrintName() method from inner class?
What is exactly wrong with statements in case 1 and case 2 ?
You haven't created an instance of the inner class. So there is no instance to call the methods on.
Modify your code to create an instance of the inner class. When you do the constructor will print out the message.
Then you can call the PrintName method on that instance.