Guest User

Untitled

a guest
Jul 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public boolean search (String lastNameSearch) {
  2. LinkedListNode<T> current;
  3.  
  4. current = first;
  5.  
  6. ExtPerson person = (ExtPerson) first.info;
  7.  
  8. while (current != null) {
  9. if (person.lastName.toLowerCase().equals(lastNameSearch.toLowerCase())) {
  10. System.out.println("Found " + lastNameSearch);
  11. return true;
  12. } else {
  13. current = current.link;
  14. person = (ExtPerson) current.info;
  15. }
  16. }
  17. System.out.println("not found " + lastNameSearch);
  18. return false;
  19. }
Add Comment
Please, Sign In to add comment