A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Elasticsearch in Action
this week in the
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
. 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
Composition versus Inheritance
exam Query : class relationships
Inheritance or composition?
Regarding inheritance and composition
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015