This is another one of those questions where the answer is "because that's how they designed it." The important thing to realize is that the variable in class three hides or shadows the one in class Two. They're two separate variables, and an instance of class three contains two different int variables named "i". For example,