posted 12 years ago
Because it isn't accessing a private variable. It's accessing a public method, and that method happens to return (a copy of) the value held by the private variable. This is one of the points of encapsulation - you can expose values when you want, but in a controlled way.