I'm going to be naughty here and refer to pointing. Think of class A's properties "pointing" to class B's when you make that assignment. Class A will inherit anything that class B has but that matches class A's definition. If class B has some properties that class A doesn't, then class A will not inherit those properties. For instance:
The line with the comment "Not gonna happen" is going to cause a compiler error. However, the line above it would end up returning 2. Think of it this way, when you do:
You're making the object "a" inherit anything that B has that is similar. So, since "a" has a method named "getVal()", and B does too, "a" will inherit the method from B instead of using it's own. However, since "a" does't have a method "getAnotherVal()", then there is no way it can inherit that method.
Did I just make this more confusing than it was?
[ June 10, 2004: Message edited by: Dean Jones ]