Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

How to remove an element from a Java List?

List<Integer> list = new ArrayList<>(Arrays.asList(0,1,2,3,4,5,6,7,8,9));
list.remove(1); // [0, 2, 3, 4, 5, 6, 7, 8, 9]
list.remove(Integer.valueOf(5)); // [0, 1, 2, 3, 4, 6, 7, 8, 9]
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #How #remove #element #Java
ADD COMMENT
Topic
Name
8+1 =