Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean contains(T item) {
- // Assume it isn't
- boolean returnValue = false;
- // Loop through the list
- Iterator<T> myIterator = this.iterator();
- try {
- while (myIterator.hasNext()) {
- // If the item is what we are looking for, we found it
- if (myIterator.next().equals(item)) {
- returnValue = true;
- }
- }
- } catch (NullPointerException e) {
- }
- return returnValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement