Campbell Ritchie wrote:If it won't compile, what is the problem?
Gaurav Raje wrote:I read through that... and apparently, the code is perfectly valid as per the spec(which is reflected in the compile process). I guess (and strictly my opinion) since the code is a little stupid, Java never bothered to address such issues.
Gaurav Raje wrote:I agree completely. It is perfectly legal and hence the compilation. But my point is, being as strict about object orientation as it is, things like this are not supposed to be allowed. For eg, the inner complications of the superclass class should be taken care of by the same class and not exposed to the end user of the class. What if the superclass which had shadowed variables was used in another method which relied on the t.t object. As per abstraction, if t.t is a valid field in the class, it should anc can be used.
Tom mmeke wrote:You are missing the point of interfaces ...
The above shows you why the comiler compiles even when you implement the same method multiple times.
The real question is, why are you defining interfaces, if you call the method from the aer class directly anyway ?