Computer Science (CSCI) Department
College of Engineering, Computer Science, & Technology (ECST)

JETT Workshops
Object-Oriented Programming

Fall 2004


Polymorphism

(Example code and figures from Computing Concepts with Java Essentials, 3rd edition, by Cay Horstmann.
Visit www.wiley.com/college/horstmann for information on the current edition of this excellent text.)

Exercise - overriding inherited methods

  • use the BankAccount project
  • override methods
    • override toString( ) in BankAccount and subclasses
    • override equals( ) in BankAccount and subclasses
    • create several objects in BankAccountTest
    • test both toString( ) and equals( )