I'm going to have my
test on Monday and have been reviewing all week. I'm a little confused on the benefit of using things like Inner classes and Local Classes. I understand the concept of subclassing, for example, parent class pet has an owner, subclass cat has what parent class pet does and then some of its own unique members, etc. As the RHE book and some others give these type of examples, such as Outer Class has Inner Class, etc. I don't understand what benefit it offers. Why wouldn't someone just sublass a parent class instead of doing nested classes? I am feeling a little unconfident as I feel I may not retain what I have learned due to not understanding the reasons to use nested classes vs. subclassing.
Can someone please offer an example that will help clarify this for me?
Thank you.