I have one Array List and contains some values like 2,3,4,5,6. now how to check if the value is present and want to delete that particular Value. please help me to do this. tnx in advance.
I tried ,
ArrayList<Integer> Positions=new ArrayList<Integer>();
Positions.remove(6);
but it shows an error.
Positions.remove(6);delete the item from particular position.So first you have to compare the item in arraylist using for loop and get the position of that item and call
Positions.remove(that Item Position in ArrayList).Try this code.
Output : I/========== After Remove ( 309): :: [3, 1, 2]