Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public boolean retainAll(LinkedList<E> c){
  2. for(int i = 0; i < size; i++){
  3. boolean match = false;
  4. E pirmas = get(i);
  5. for(int j = 0; j < c.size; j++){
  6. E antras = c.get(j);
  7. if(pirmas == antras){
  8. match = true;
  9. break;
  10. }
  11. }
  12. if(match == false){
  13. remove(pirmas);
  14. i--;
  15. }
  16. }
  17. return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement