Integer.valueOf(1) ; -128 128 , , Integer (1) . , , (Integer, Long, BigDecimal ..), , , , autoboxing .
Bart van Heukelom, the difference between list.remove (1) and list.remove (new Integer (1)) is this; list.remove (1) will remove the object from index 1 from the list, list.remove (new Integer (1)) will remove all objects in the list that are equal to the Integer object with a value of one. Remember that collections cannot store primitives, only objects.
source
share