why interfaces are faster than abstract classes?

Answer Posted / aruna raman

Actually abstract are faster than interfaces classes.

interfaces are Slow, requires extra indirection to find the
corresponding method in the actual class. Modern JVM's are
discovering ways to reduce this speed penalty.

Abstract Class ::
- It cannot defines all the methods
- It has subclass.
- Here, Subclass is useless
- A class can be extend an abstract class

Interface ::
- It defines all the methods
- It must have implementations by other classes, But there
will be no use of that.
- Only an interface can extend another interface.

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is float in java?

557


Is java programming easy?

534


What is n in java?

535


Why multiple inheritance is not supported by java?

509


How does the garbage collector works in java?

566






Can a private method of a superclass be declared within a subclass?

525


If an object is garbage collected, can it become reachable again?

538


What is a map? What are the implementations of map?

552


What are the wrapped, classes?

595


What are passing parameters?

583


What is the use of object and class classes?

563


Can we assign null to double in java?

542


What is the meaning of 3 dots in java?

680


What is strings in java?

581


How do you compare two strings lexicographically?

533