因为看到泛型类的声明和实例化有两种写法,比如:
private Stack<Integer> data = new Stack<Integer>();
private Stack<Integer> data = new Stack<>();
想问一下这两种写法有什么区别呢?
相似问题