Koti Samadhi wrote:Difference between Abstract Class and Interface, Which scenarios we are using both?
Hi Koti,
Both expose the concept "Abstraction". Abstract classes are useful when you need to provide a common set of method implementation(s) for all the subclasses to share. Most modern frameworks build around the concept of interfaces.
Purpose of both abstract class and interface is almost the same, except you can use abstract class when some of the implementation is fixed(few methods are implemented) and rest of the implemtation is left to the user.
hi this is simple....
In Interface only abstract and public access specifiers are allowed...
In abstract classes all normal access specifiers are allowed..
abstract classes should not be instantiated..
Use abstract keyword for abstract classes..
Use interface keyword for interfaces..