Sunday 25 October 2015

Difference between Abstract and Interface?

Difference between Abstract and Interface? Abstract Class: 1.Abstract method does not contain any definition -Abstract class prov... thumbnail 1 summary

Difference between Abstract and Interface?

Abstract Class:

1.Abstract method does not contain any definition-Abstract class provides a set of rules to implement next class

2.If a class contains at least one abstract method then it must be declared as an “Abstract Class”

3.While inheriting abstract class all abstract methods must be override

4.Abstract classes are also called as “Partial abstract classes”

5.Partial abstract class may contain functions with body and functions without body

6.If a class contains all functions without body then it is called as “Fully Abstract Class”

Interface:

1.If a class contains all abstract methods then that class is known as “Interface”

2.Interfaces support like multiple inheritance

3.In interface all methods are public abstract by default

4.Interfaces can be instantiated, but a reference cannot be created 

No comments

Post a Comment