File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Query on implementation inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Query on implementation inheritance" Watch "Query on implementation inheritance" New topic
Author

Query on implementation inheritance

Rajiv Rai
Ranch Hand

Joined: Jun 14, 2010
Posts: 57
I have been reading java interview questions and read the following about implementation inheritance.


"When using implementation inheritance, make sure that the sub-classes depend only
on the behavior of the superclass, not on the actual implementation."

Am confused about what the above statement means?
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7032
    
  16

Rajiv Rai wrote:Am confused about what the above statement means?

Basically, what it means is that you shouldn't rely on a method having a particular implementation when you call it. And I'd go further and say that the statement applies whether you're using interface inheritance or not.

When tutorials refer to 'behaviour', they usually mean methods; when they talk about 'implementation', they're referring to code. You can call a method without having to know the code it contains.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query on implementation inheritance
 
Similar Threads
OOConcepts
Difficulty in Java 1.5
MULTIPLE IMPLEMENTATION INHERITANCE
MultipleImplementation Inheritance using Inner Class
Realization/Generalization?