|
@@ -7,7 +7,7 @@ import java.util.ArrayList;
|
7
|
7
|
* If you pop on an empty stack, throw an IndexOutOfBoundsException.
|
8
|
8
|
*/
|
9
|
9
|
public class Stack<E> {
|
10
|
|
- private ArrayList elements;
|
|
10
|
+ private ArrayList<E> elements;
|
11
|
11
|
|
12
|
12
|
|
13
|
13
|
public Stack(){
|
|
@@ -19,7 +19,7 @@ public class Stack<E> {
|
19
|
19
|
}
|
20
|
20
|
|
21
|
21
|
public E pop(){
|
22
|
|
- E value = (E) elements.get(elements.size() -1);
|
|
22
|
+ E value = elements.get(elements.size() -1);
|
23
|
23
|
elements.remove(elements.size() -1);
|
24
|
24
|
return value;
|
25
|
25
|
}
|