SyntaxFix
Write A Post
Hire A Developer
Questions
This is not possible. The java specification forbids the use of primitives in generics. However, you can create ArrayList<Integer> and call add(i) if i is an int thanks to boxing.
ArrayList<Integer>
add(i)
i