CISC 323, extra slides for 19 Jan 2004 1
- a few remarks & questions
- review dynamic binding/polymorphism
- practice UML as time permits
Wednesday: debugging Friday: start GUIs
Plan For Today
CISC 323, extra slides for 19 Jan 2004 2
- no strike ☺
- reminders:
- Assignment 1 due next Friday
- readings for OOP/UML
- may read ahead about GUIs (courseware)
- Spirit Rover & Java
- JBuilder question & folders
- UML questions:
- class variables in object diagrams
- concurrency in sequence diagrams
- interrupts in activity diagrams
Remarks & Questions
CISC 323, extra slides for 19 Jan 2004 3
Encapsulation, Inheritance, Polymorphism Webster's dictionary definition of polymorphism: The capability of assuming different forms; the capability of widely varying in form.
Polymorphism
In object-oriented programming, polymorphism refers to the capability of having objects whose specific class not known until run time.
CISC 323, extra slides for 19 Jan 2004 4
Example: An Array of Employees
Employee people[] = .....; // pay everybody for a 10-hour day. for (int i = 0; i < people.length; i++) { people[i].pay(10); each people[i] may be plain Employee
- r Salesperson or Executive or Unionized