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
If system.exit (0); is written at the end of the try block, will the finally block still execute?
what is the final keyword denotes in java?
Explain covariant method overriding in java.
How does arraylist size increase in java?
What is an array length?
Define reflection.
Explain how hashmap works?
what is the difference between process and thread? : Java thread
What is java life cycle?
What is the difference between private & public & friendly classes?
Why charat is used in java?
What's the purpose of static methods and static variables?
How do I enable java in safari?
What is the difference between delete and delete[]
Explain about features of local inner class?