This commit is contained in:
Ninja-Jambon 2024-03-13 11:57:49 +01:00
parent 9becc62ff7
commit 556869ebb8
3 changed files with 63 additions and 9 deletions

View file

@ -13,6 +13,10 @@ public class Stack <T> {
array = new Vector<T>();
}
public Stack(Vector<T> array) {
array = array;
}
// Methods
public void push(T x) {
@ -28,4 +32,8 @@ public class Stack <T> {
public int size() {
return this.array.size();
}
public Stack copy() {
return new Stack(new Vector<T>(this.array));
}
}