Is there a way to create a list of primitive int or any primitives in java like following?
List myList = new ArrayList();
This is not possible. The java specification forbids the use of primitives in generics. However, you can create ArrayList and call add(i) if i is an int thanks to boxing.
ArrayList
add(i)
i