My apologies, I had considered this scenario, but I was strongly convinced that you could actually access the private members of top-level classes declared within the same file.
Ganesh Patekar wrote:Rather I would say private members are directly accessed only within the class they are declared in.
This is also not correct. A nested class can access private members of an enclosing class, and an enclosing class can access private members of a nested class.
I guess the correct way to describe private access would be: Only code within the declaring class, or code within enclosing or nested classes of the declaring class can access the private member.