# implement vs extend



## tovachanah (Feb 15, 2006)

we are learning about polymorphism which means that we are learning about "extends", "implements" abstract classes and interfaces.

i understand that classes that extend and implement have an "IS A" relationship w/ the supercalss

what i don't understand is the difference 'tween "EXTENDS" and "Implements"

i understand you "extend" abstract classes as a way of code resuability (i.e. not re-inventing the wheel" and i understand that you "implement" interfaces for the same reason except that an interface reuses code for things that are similar but still different (eg. paying an invoice and paying an employee's salary - both are payables)

i also see that a class can only "extend" one class but "iimplement" many intefaces

in my first java class the teacher used "extends" w/ ActionListener and "implements" w/ "ItemListener"
but both are interfaces.


(did i answer my own q?)


----------



## Chicon (Jul 29, 2004)

Hi tovachanah,

There is a good explanation on this page.

Have a good read !


----------

