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
What is the symbol for line break?
How many types of gc are there in java?
Differentiate storage classes on the basis of their scope?
What is a qms manual?
What is isa relationship?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
What is the full name of java?
Where are register variables stored?
What’s a deadlock?
What does it mean to flush a file?
what is synchronization and why is it important? : Java thread
Explain the use of shift operator in java. Can you give some examples?
How do you detect memory leaks?
Difference between stack and queue?
What is collections framework?