Java Java Data Structures Organizing Data Interfaces

Courtney Wilson
Courtney Wilson
1,687 Points

What does he mean @ 9:43?

I have two (related) questions. In regards to

Treet other = (Treet) obj; ... if (dateCmp == 0) { return mDescription.compareTo(other.mDescription); }

Craig explains how we are able to access the private variable mDescription of the "other" instance. I (think) I understand how it works but he says something that throws me off. Can someone explains what he means by this:

9:34 It's private to this class here but we're in the class, so we are able to see it. 9:43 Any class can see private variables of other classes

I thought only the class in which a private variable is declared can see its private variables. In this case, since "other" is an instance of the Treet class, it's private variables should be accessible because we are in the same class. But in any other classes, we wouldn't be able to access them, correct?