I think if u view it from an object oriented perspective rather than variables and methods. The best way to manipulate variables is through method interfaces. Thats what encapsulation is all about. In java methods matching in signature r overrided not shadowed. I hope i was answering your question. Thanks Thomas
This can lead you into very confusing and potentially buggy places. Say you have a bunch of methods on sh and sh2 that reference i. sh thing1 = new sh(); sh2 thing2 = new sh2(); thing2.methodOnSh(); // this will use the i on sh thing2.methodOnSh2(); // this wlil use the i on sh2 Confused? Then the short answer is Don't Do That! (Seen Terminater 3 yet?) Overload and override methods for good OO fun, but I've never had a reason to shadow variables. Anybody else?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi