问题:
public class StackTest {
public static void main(String[] args) {
Stack<Integer> st = new Stack<Integer>();
st.push(new Integer(11));
st.push(new Integer(22));
st.push(new Integer(33));
System.out.println("size is-> "+st.size());
System.out.println("Top is-> "+st.peek());
st.pop();
System.out.println("new Top is-> "+st.peek());
}
}
、size is-> 3 Top is-> 33 new Top is-> 22
、size is-> 4 Top is-> 33 new Top is-> 22
相关内容