Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 13 Online
OpenStudy (anonymous):

Since interfaces contains only empty methods (in java) ,then why do we implement these interfaces ?what's the use of implementing these empty methods ? is Overriding a factor here ?

OpenStudy (anonymous):

There are a number of reasons to implement interfaces. One of the chief reasons is Java allows only one tree of inheritance, thus a class can only inherit fron a single ancestor class line. Interfaces, to some extent, overcome the limitation of single tree inheritance by allowing a class to implement methods from multiple ancestors. The discussion can get much more technical but this is a simplified single reason for interfaces.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!