Tuesday, July 21, 2009

java

Difference between abstract class and interface

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