MyGStack.java
Select all
import java.util.*; public class MyGStack
{ private Vector
v; public MyGStack() { v = new Vector
(); } public void clear() { v.clear(); } public void push(T n) { v.addElement(n); } public T pop() { return v.remove(v.size()-1); } public boolean isEmpty() { return v.isEmpty(); } }