Wednesday 26 September 2012

What are differences between Abstract and Interface?

Hi friends ,here i have explained "What are differences between Abstract and Interface".


Abstract Class:
->abstract  class provides a set of rules to implement next class.
->Abstract method does not contain any definition.
->In abstract all method are default.
->If a class contains at least one abstract method then it must be declared as an “Abstract class”.
->Abstract  classes cannot be instantiated i.e we cannot create object, but reference  can be created.
->If  a class contains all functions without  body then it is called as “Fully Abstract Class” .i.e Interface.

Interface:
->If a class contain all abstract methods then that class is known as “Interface”.
->Interface support multiple inheritance.
->In interface all method are public  by default.
->Interfaces are implementable.
->Interfaces cannot be instantiated , but a reference can be created.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.