top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are the alternatives to inheritance?

+2 votes
63 views
What are the alternatives to inheritance?
posted Dec 11, 2014 by Joy Nelson

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Alternatives of Inheritance:

1. Delegation is an alternative to inheritance.

2. Delegation denotes that you include an instance of any class as an instance variable, and forward messages to the instance.

3. It is safer than inheritance because it ceases you to think about forwarded message , because the 
     instance is of a known class, rather than a new class, and because it doesn’t force you to accept all the 
     methods of the super class: you can provide only the methods that really make sense.

4. On the other hand, it makes you write more code, and it is harder to re-use (because it is not a subclass).
answer Dec 12, 2014 by Karthick.c
Similar Questions
+3 votes

Are there any good, open source alternatives to Display-tag?

+2 votes

I need to use the Cisco conf call tool WexEx. It looks like that it is the same issue than with Skype (32 bits).

I want to know what are the open alternatives to WebEX ?

...