CS136, Lecture 10


Discuss next homework assignment.

If class A extends B then A automatically gets all methods & instance variables from B.

A can also add new methods or redefine the "inherited" methods.

When redefine methods, can call original version from superclass:

   super.meth(a,b)
With constructors, simply write
   super(...)
to first execute the constructor of the superclass.

See examples with Position and RowOrderPosn as well as CurDoublyLinkedList as extension of DoublyLinkedList.