InterviewSolution
| 1. |
What is the difference between Interface and Abstract class? |
|||||||||||||||||||||
Answer»
An abstract class is a special kind of class that can be inherited but cannot be instantiated. For a class to be an abstract class, there should always be at least one abstract METHOD should be present.
Interface is not a class, it is an entity that is defined by the work Interface. Like Abstract class we cannot create an instance of Interface. It has no implementation; only has the signature i.e. just the definition of the methods without the body. Advantage of Interface is that it provides a way for a class to be a part of two classes: one from inheritance hierarchy and one from the interface. Difference between Interface and Abstract Class
|
||||||||||||||||||||||