I want to declare an ArrayList
of type int
.
Why does the following give me an error:
ArrayList<int> list1 = new ArrayList<int>();
But the following works:
ArrayList<Integer> list1 = new ArrayList<Integer>();
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…