Difference between abstract class and Interfaces?
Answer Posted / taresh nama
• Interfaces provide a form of multiple inheritances.
A class can extend only one other class.
• Interfaces are limited to public methods and
constants with no implementation. Abstract classes can have
a partial implementation, protected parts, static methods,
etc.
• A Class may implement several interfaces. But in
case of abstract class, a class may extend only one
abstract class.
• Interfaces are slow as it requires extra
indirection to to find corresponding method in in the
actual class. Abstract classes are fast.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is default exception handling in java?
What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?
Can You Have Virtual Functions In Java?
What is the history of java?
When should I use singleton pattern?
Write a program in java to find the maximum and minimum value node from a circular linked list.
What do you know about java?
How to obtain a performance profile of java program
Differentiate between == and equals().
Can I declare a class as private?
What are the parts of methodology?
What is ‘has a’’ relationship in java?
How do you convert an int to a string in java?
What are extraneous variables examples?
What is passing value java?