Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

retainAll java

public void retainAll(int[] arr)
    {
       for (int i = 0; i < size; i++)
        {
            if(!Arrays.toString(arr).contains(Integer.toString(elementData[i]))){
                remove(i);
                i--;
            }
            
        }
    }
 
PREVIOUS NEXT
Tagged: #retainAll #java
ADD COMMENT
Topic
Name
9+3 =