Difference between Interface and Abstract Class?

View previous topic View next topic Go down

Difference between Interface and Abstract Class?

Post  Admin on Sat Aug 27, 2011 12:19 pm

An interface declares a set of related methods, outside of any class

An abstract class is an incomplete class definition that declares but does not define all of its methods

An interface defines an API that is independent of any class hierarchy. Interfaces are the ultimate encapsulators, but they hide all the details of the classes that implement their methods from the user of the interface.

Unlike an interface, an abstract class is a proper class. Unlike a concrete class, some of its behaviors are deliberately left to be defined by its own subclasses. Abstract classes cannot be instantiated because of this - only instances of concrete subclasses can be created.

Admin
Admin

Posts : 131
Join date : 2011-08-16

View user profile http://codefornongeek.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum