Skip to content

Commit dcc5159

Browse files
Update generic-classes.md
changed a stack pop to stack.pop()
1 parent 4aa78e1 commit dcc5159

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_tour/generic-classes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ To use a generic class, put the type in the square brackets in place of `A`.
3838
val stack = new Stack[Int]
3939
stack.push(1)
4040
stack.push(2)
41-
println(stack.pop) // prints 2
42-
println(stack.pop) // prints 1
41+
println(stack.pop()) // prints 2
42+
println(stack.pop()) // prints 1
4343
```
4444
The instance `stack` can only take Ints. However, if the type argument had subtypes, those could be passed in:
4545
```

0 commit comments

Comments
 (0)