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
Differentiate between == and equals().
What are the two ways to create a thread?
Explain the difference between runnable and callable interface in java?
Explain how to convert any java object into byte array.
What is the use of singleton class?
What classes of exceptions may be caught by a catch clause in java programming?
Can constructor be protected in java?
What is the difference between sleep and wait in java?
What are assembly attributes?
What is the purpose of java?
What are class types in java?
Does java support function overloading, pointers, structures, unions or linked lists?
What is the difference between sop and work instruction?
Are static members inherited to sub classes?
What does I ++ mean?