使用Stack类的push方法为什么老出现警告啊?
import java.util.Stack;public class TextMain {
public static void main(String[] args) {
Stack myStack = new Stack();
String s = "afafdf";
myStack.push(s); //warning: Type safety: The method push(Object) belongs to
//the raw type Stack. References to generic type Stack<E>
//should be parameterized
}
}
为什么会出现这样的警告啊? 求解答,先谢谢啦!