What are the performance implications of interfaces over abstract classes?

Answer Posted / shakir

Interfaces are slower in performance as compared to abstract classes as extra indirections are required for interfaces. Another key factor for developers to take into consideration is that any class can extend only one abstract class while a class can implement many interfaces.
Use of interfaces also puts an extra burden on the developers as any time an interface is implemented in a class; developer is forced to implement each and every method of interface.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is alive method in java?

586


What is generics in java interview questions?

634


Why webdriver is an interface?

675


What are keywords give examples?

665


What is function overriding and overloading in java?

685






What is a modifier?

988


Can I import same package/class twice?

582


What is the benefit of singleton pattern?

636


Can java hashmap have duplicate keys?

594


What does singleton mean in java?

601


How java is similar to c?

678


What is the use of toarray () in java?

642


What is the size of arraylist in java?

682


What is a java object and java application?

668


What is getkey () in java?

664