Common knowledge in Java

A few notes, observations that I would like to document about Java. This may be common,trivial knowledge, but I just want it to be in one place.

Thursday, June 23, 2005

Difference between Abstract and Interface

  • Interface only provides the contract, does not add default behaviour, whereas abstract classes provide default behaviour (not necessarily, only if you want to, but that is the point)
  • You can implement as many interfaces as you may want, but only extend from one abstract class
  • You cannot have private, protected variables in an Interface.

0 Comments:

Post a Comment

<< Home