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 a dynamic array java?
How can I right-justify a string?
What are the four pillars of java?
Explain the importance of import keyword in java?
Who found java?
What is garbage collector?
What is <> used for in java?
List primitive java types?
What are different types of multitasking?
What is the difference between array and array list in java?
What is the set interface in java programming?
Is java developer a good career?
If system.exit (0); is written at the end of the try block, will the finally block still execute?
Explain the difference between throw and throws in java?
Which is bigger double or float?