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 purpose class.forname method?
How is a structure different from array ?
Can we override a variable in java?
Difference between java and javascript
what are the disadvantages of indexes in oracle?
What is data movement?
What is the basic concept of java?
How does java pattern compile work?
How we can generate random numbers in java?
What are constructors in java?
Can we convert stringbuffer to string?
Explain about complier design(phases)
What purpose do the keywords final, finally, and finalize fulfill?
Explain about wait() method?
How to read and write image from a file ?