Is there any other way that you can achieve inheritance in Java?

Q

Is there any other way that you can achieve inheritance in Java?

✍: Guest

A

There are a couple of ways. As you know, the straight way is to "extends" and/or "implements". The other way is to get an instance of the class to achieve the inheritance. That means to make the supposed-super-class be a field member. When you use an instance of the class, actually you get every function available from this class, but you may lose the dynamic features of OOP

2012-08-29, 2087👍, 0💬