You essentially are in an apartment (the nested class) that is located inside a large house. Your apartment analogy does completely make sense here.
The outer class can not access private members of the inner / nested class. So the nested class can access private variables and methods of the outer class. Even though they are technically two separate classes, the nested class is within the scope of the outer class.
First having a nested class, those two classes are somewhat related.There are only a few exceptions and maybe you hit one of them. Click to expand.You've going on for 3 posts now stating that another external class can access private members of another external class but you still have not shown any example.