In page 428 (the chapter about Type Information) of his \"Thinking In Java, 4th Ed.\", Bruce Eckel has the following example:
public class Staff extends Arra
The add
method that takes a String
and a Person
is calling a different add
method that takes a Position
. The one that takes Position
is inherited from the ArrayList
class.
Since your class Staff
extends ArrayList
, it automatically has the add(Position)
method. The new add(String, Person)
method is one that was written particularly for the Staff class.