Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Outline
In the last lecture, we continued our discussion of Objects…
Creating and Using Constructors:
Used to create object instances with differing characteristics.
Example: JTrain (cont.)
Inheritance
Which we used to create ‘Derived Classes’...
Which inherit the characteristics of a Base Class
Example: The JFreightTrain Class
Overriding Base Class Constructors
A client of the Method (and Object) does not have to realize this.
The Method may the be called more-or-less freely…
Without knowing which Class (Base or Derived) an instance belongs to.
Or even that several different behaviors have been defined.
The behavior defined for each specific type will simply occur, automatically.
Next Lecture:
We will finish our ArrayList…
And illustrate, with a generalized Multiple-JTrain Example.
And combine our JTrain Classes
into a new Class Library called ‘TrainsLib’.