Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean retainAll(LinkedList<E> c){
- for(int i = 0; i < size; i++){
- boolean match = false;
- E pirmas = get(i);
- for(int j = 0; j < c.size; j++){
- E antras = c.get(j);
- if(pirmas == antras){
- match = true;
- break;
- }
- }
- if(match == false){
- remove(pirmas);
- i--;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement