Sunday 4 January 2015

Difference between an interface and abstract class?


Interface :
-all the methods having only declaration but no definition.(We have to override all the methods to add definition)
-all the methods are public.(If you have private methods, we can't inherit that method in child class, then we can't override it. In interface all methods should be override in child class)

Abstract 
-we can have some concrete methods. (Mean some methods will have definition, some are no definition).
-An abstract class may have private methods.