From dcc51592443ca85e535c71068137865daf1ef17e Mon Sep 17 00:00:00 2001 From: czasoprzestrzenny <46657059+czasoprzestrzenny@users.noreply.github.com> Date: Fri, 11 Feb 2022 15:41:48 +0100 Subject: [PATCH] Update generic-classes.md changed a stack pop to stack.pop() --- _tour/generic-classes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_tour/generic-classes.md b/_tour/generic-classes.md index 0b479d30df..d883e88115 100644 --- a/_tour/generic-classes.md +++ b/_tour/generic-classes.md @@ -38,8 +38,8 @@ To use a generic class, put the type in the square brackets in place of `A`. val stack = new Stack[Int] stack.push(1) stack.push(2) -println(stack.pop) // prints 2 -println(stack.pop) // prints 1 +println(stack.pop()) // prints 2 +println(stack.pop()) // prints 1 ``` The instance `stack` can only take Ints. However, if the type argument had subtypes, those could be passed in: ```