DEVFYI - Developer Resource - FYI

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

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

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

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

(Continued on next question...)

Other Interview Questions