x 4 class Sub extends Super public Sub Systemoutprintln

X 4 class sub extends super public sub

This preview shows page 28 - 35 out of 35 pages.

}
Image of page 28
29 More rules for method overriding: The argument list should be exactly the same as that of the overridden method. Instance methods can be overridden only if they are inherited by the subclass. A method declared final cannot be overridden. A method declared static cannot be overridden but can be re-declared.
Image of page 29