Abstract Class
Interface
- Abstract class is inherited.
- We cannot create an object of abstract class.
- Abstract class does not support multiple inheritance.
- Abstract class contains Constructors.
- An abstract class may contain abstract methods as well as concrete methods(non- abstract methods).
- Only Complete Member of abstract class can be Static.
- Class inheriting an abstract class has to override the abstract methods from abstract class while implementing them.
Interface
- Interface is not inherited but it is implemented.
- We can create an object of interface by type casting it to class name.
- Interface support multiple inheritance.
- Interface doesn’t contains Constructors.
- An interface Contains only the declaration of the method.
- Member of interface can not be Static.
- Class implementing an interface has to implement all the methods of the interface compulsorily.
0 comments:
Post a Comment