Great! Now we have a type-safe ArrayList, which means that every element has to be a String
-type value.
Psst: we can but don't have to repeat the type restriction when we call the constructor.
If ArrayLists only work with reference types like String
, doesn't that exclude primitive types like double
and int
?