I am working on some legacy code and have come across something that I\'m not sure of. We have a class y that is declared inside of another class x.
class y
class x
You create an inner class because it is only ever used within the scope of class x and it logically fits in the factoring/architecture of class x.
Class y might also be privy to implementation details of class x that are not meant to be known to the public.