Cast to the interface type
In this case, there is another choice.
Because
- both classes implement the interface named Prob05X,
and
- the method named getModifiedData is declared in that
interface,
- it also works to cast both references to the common interface type
Prob05X.
That is what was done in Listing 10.
Both references were cast to the interface type Prob05X.