-
List
and its supporting classes
(such as ArrayList)
can be used to manipulate lists of objects of any classes.
-
We can have a list of strings, a list of people,
a list of shapes, ...
-
This is possible because the interface
and the classes are written in terms of the class
Object.
-
It is possible to add objects of many different classes to a
list.
-
Most of the time we will not want to do this.
-
If we do it inadvertently,
this error will not be detected at compilation time
as what we have written is allowed.