Monday, April 30, 2012

nikhil kansal What’s the difference between an interface and abstract class?

1. Abstract classes can have implementations for some of its members, but the interface can't have implementation for any of its members.

 2.Interfaces cannot have fields where as an abstract class can have fields.

3. An interface can inherit from another interface only and cannot inherit from an abstract class, where as an abstract class can inherit from another abstract class or another interface.

4. A class can inherit from multiple interfaces at the same time, where as a class cannot inherit from multiple classes at the same time.

5. Abstract can have access modifiers where as interface members cannot have access modifiers.
projects for computer science

No comments:

Post a Comment