diff --git a/_tour/generic-classes.md b/_tour/generic-classes.md index 2433cd6b45..9088cc95d8 100644 --- a/_tour/generic-classes.md +++ b/_tour/generic-classes.md @@ -31,6 +31,8 @@ class Stack[A] { ``` This implementation of a `Stack` class takes any type `A` as a parameter. This means the underlying list, `var elements: List[A] = Nil`, can only store elements of type `A`. The procedure `def push` only accepts objects of type `A` (note: `elements = x :: elements` reassigns `elements` to a new list created by prepending `x` to the current `elements`). +`Nil` here is an empty `List` and is not to be confused with `Null`. + ## Usage To use a generic class, put the type in the square brackets in place of `A`.