|
@@ -8,14 +8,21 @@ import java.util.Stack;
|
8
|
8
|
* Remember, you might need to resize the stack in the push method.
|
9
|
9
|
* @param <E>
|
10
|
10
|
*/
|
11
|
|
-public class GenericStack<E> extends Stack<E> {
|
|
11
|
+public class GenericStack<E> {
|
12
|
12
|
private E[] elements;
|
13
|
13
|
|
|
14
|
+ GenericStack<String> myStack = new GenericStack<>();
|
|
15
|
+
|
14
|
16
|
public GenericStack() {
|
15
|
17
|
}
|
16
|
18
|
|
17
|
|
- @Override
|
18
|
|
- public synchronized boolean isEmpty() {
|
19
|
|
- return super.isEmpty();
|
|
19
|
+ public E isEmpty() {
|
|
20
|
+
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ public void push(E foobar) {
|
|
24
|
+ }
|
|
25
|
+
|
|
26
|
+ public E pop() {
|
20
|
27
|
}
|
21
|
28
|
}
|