SHARE
TWEET

Untitled

a guest Jun 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void findNameOnly(String name) {
  2.         for (int j = 0; j < this.myContacts.size(); j++) {
  3.  
  4.             System.out.println("name = " + name);
  5.             System.out.println("getname() = " + this.myContacts.get(j).getName());
  6.             System.out.println("value of j = " + j);
  7.             System.out.println(this.myContacts.get(j).getName().trim() == name.trim());
  8.  
  9.             System.out.println("name length = " + name.length());
  10.             System.out.println("getname() length = " + this.myContacts.get(j).getName().length());
  11.  
  12.             if (this.myContacts.get(j).getName().trim() == name.trim()) {
  13.                 System.out.println("Found SOME record...");
  14.             } else {
  15.                 System.out.println("NO MATCH");
  16.             }
  17.             }
  18.         }
  19.      
  20. getname() = Jon
  21.      
  22. getname() length = 3
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top