java.util.Stack有什么问题?

时间:2017-08-11 02:35:12

标签: java

使用Stack s = new Stack()初始化基本堆栈并没有实际的方法吗?不存在pushpop方法?

按照此基本tutorial,错误消息显示The method push(Integer) is undefined for the type Stack。 例如像这样的基本操作:

import java.util.*;

public class StackOfPlates {

    public static void main(String[] args) {
        Stack s = new Stack();
        s.push(new Integer(6));
    }
}

引发未定义的函数错误。我错过了一些明显的东西吗?

0 个答案:

没有答案