0
Wrapper Classes
Why does the arraylist want the wrapper class? ArrayList<int> list = new ArrayList<int>(); ArrayList<Integer> list = new ArrayList<Integer>();
1 Antwort
0
It has to do with implementation. The List is designed to work with objects, not primitive types. There simply is no way to create a container that can contain any primitive type or object in Java. But it doesn’t matter as long as you remember to use Integer instead of int.