Tuesday, September 1, 2009

Abstract class Vs Interfaces

Hi Guys 
 These are few difference's that will be sufficient to understand what exactly abstact class and interface is and what is the difference between them
  1. Abstract class defines few or none of the methods,but interface defines all the methods.
  2. Abstract classes should have subclasses else that will be useless.Interfaces must have implementations by other classes else that will be useless.
  3. only an interface can extend another interface, but any class can extend an abstract class.
  4. All variable in interfaces are final by default.

No comments:

Post a Comment