Creating generic classes

We are going to learn how to create a generic class in this lesson.

Generic class syntax #

The syntax for a generic class is similar to that of a generic interface:

class ClassName<T1, T2, ...> {
  ...
}

The members of the class can reference the types passed into it.

Get hands-on with 1200+ tech skills courses.