Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean search (String lastNameSearch) {
- LinkedListNode<T> current;
- current = first;
- ExtPerson person = (ExtPerson) first.info;
- while (current != null) {
- if (person.lastName.toLowerCase().equals(lastNameSearch.toLowerCase())) {
- System.out.println("Found " + lastNameSearch);
- return true;
- } else {
- current = current.link;
- person = (ExtPerson) current.info;
- }
- }
- System.out.println("not found " + lastNameSearch);
- return false;
- }
Add Comment
Please, Sign In to add comment