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 a boolean used for?
I want to store more than 10 objects in a remote server? Which methodology will follow?
what are synchronized methods and synchronized statements? : Java thread
How do you write a scanner class in java?
What are three advantages of using functions?
What is OOP Language?
What is the use of toarray () in java?
How does system arraycopy work in java?
What are predefined functions?
Explain the selection sort algorithm and state its time complexity?
What is the hashcode () and equals () used for?
How do you use nextline in java?
What do you mean by platform independence of Java?
What is java english?
What does nextint () do in java?