I need to remove item with value 4 from the following list.
List<Integer> list = Array.asList(1,4,5,6,7);
sukanya meruva Answered question
As the list item start with index 0 and we need to remove the 4 which is in the position of 1. We can remove the list item based on the index as follows.
List<Integer> list = Array.asList(1,4,5,6,7);
list.remove(1); //remove the value 4 at index 1
sukanya meruva Answered question