Skip to content

What is meant by parameterized type?

This link states the following:

The instantiation of a generic type with actual type arguments is called a parameterized type .
Example (of a parameterized type):

Collection<String> coll = new LinkedList<String>();

So what is the parameterized type?

  • Collection<String> or
  • LinkedList<String>

Answer

They are both parameterized types: types that take other types as parameters.

The fact that you have different types on the two sides of the expression is irrelevant, and has to do with polymorphic behavior i.e. because LinkedList is a subtype of Collection.