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 use of parseint in java?
Are registers volatile?
What is operator overloading. Is it is supported in java?
Why do I need to declare the type of a variable in java?
Is java programming easy?
Is there any case when finally will not be executed?
What is primitive array?
What is a conditional statement explain with example?
Program to Find the second largest element in an array.
What is numeric function?
Which collection is sorted in java?
What are the different types of collections in java?
What is string manipulation?
What are the basic control structures?
What do you understand by an io stream?