Amy Gill il y a 6 ans
Parent
révision
a6113fdaf1
2 fichiers modifiés avec 16 ajouts et 9 suppressions
  1. 5
    5
      src/main/java/Stack.java
  2. 11
    4
      src/main/java/StackArray/GenericStack.java

+ 5
- 5
src/main/java/Stack.java Voir le fichier

1
-public class Stack{
2
-    public boolean isEmpty(){
3
-        return false;
4
-    }
5
-}
1
+//public class Stack <E>{
2
+//    public boolean isEmpty(){
3
+//        return false;
4
+//    }
5
+//}

+ 11
- 4
src/main/java/StackArray/GenericStack.java Voir le fichier

8
  * Remember, you might need to resize the stack in the push method.
8
  * Remember, you might need to resize the stack in the push method.
9
  * @param <E>
9
  * @param <E>
10
  */
10
  */
11
-public class GenericStack<E> extends Stack<E> {
11
+public class GenericStack<E> {
12
     private E[] elements;
12
     private E[] elements;
13
 
13
 
14
+    GenericStack<String> myStack = new GenericStack<>();
15
+
14
     public GenericStack() {
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
 }