Two Laptop Bag*
The moose likes Java in General and the fly likes A question on object reusability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "A question on object reusability" Watch "A question on object reusability" New topic
Author

A question on object reusability

Vallabhaneni Suresh Kumar
Ranch Hand

Joined: Mar 01, 2004
Posts: 68
What is the difference between object reuse using inheritance versus object reuse using composition. Which of these techniques breaks the encapsulation of the extended object.


Thank you
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

This is either an interview question, or a school essay question. We won't answer it for you, but we could help you put an answer together. First tell us what "inheritance" and "composition" are.


[Jess in Action][AskingGoodQuestions]
Vallabhaneni Suresh Kumar
Ranch Hand

Joined: Mar 01, 2004
Posts: 68
Holding the reference of the other class within some other class is known as composition.
Acquiring the properties of a base class into the child class is known as inheritance

Thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A question on object reusability
 
Similar Threads
OOP and JDBC
remote objects
the real concept behind statement object
justify answer object reuse
Easy stringbuffer questions