Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Composition Vs Inheritance
Joined: Mar 12, 2008
Feb 09, 2009 07:25:03
discussion, it is mentioned that
In composition, you can change the member objects @ runtime, to dynamically change the behaviour of the program.
Inheritance does not have this flexibility since compiler must place compile time restrictions on classes created with inheritance.
I doesn't understand this concept.
Can any one give an example code illustration this.
Joined: Aug 03, 2008
Feb 09, 2009 07:46:29
Hi Balakrishna! Welcome to javaranch.
I think by TIJ you mean Thinking in Java. Anyways I think this is not related to
as it is more of a general Object Orientation concept which is not tested in SCJP...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
subject: Composition Vs Inheritance
Regarding inheritance and composition
Inheritance or composition?
Composition versus Inheritance
exam Query : class relationships
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014