What is the difference between abstract class and interface?
Answer Posted / ranganathkini
An interface is purely contractual in that it only defines
method headers but no implementation. Classes that implement
the interface must provide implementation to all method
defined by the interface.
An abstract class contains partial implementation, i.e. it
provides implementation for some methods where as just
defines abstract method headers for other. Abstract classes
cannot be instantiated directly and have to be extended by
subclasses who implement the abstract methods defined in the
abstract superclass. Unlike an interface, subclasses of the
abstract class only need to implement only those methods
that are marked abstract.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
How many bits is a float?
What are constructors in java?
What is int lol?
Why is it called buffering?
What does java final mean?
Explain what do you mean by functional overloading in java?
What is type conversion in java?
What are multiple inheritances?
Can a variable be local and static at the same time?
What is the difference between yielding and sleeping in java programming?
What is the use of inner class?
How do you stop a thread in java?
What are java packages? What's the significance of packages?
Does a function need a return?
What are advantages of exception handling in java?