Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void findNameOnly(String name) {
- for (int j = 0; j < this.myContacts.size(); j++) {
- System.out.println("name = " + name);
- System.out.println("getname() = " + this.myContacts.get(j).getName());
- System.out.println("value of j = " + j);
- System.out.println(this.myContacts.get(j).getName().trim() == name.trim());
- System.out.println("name length = " + name.length());
- System.out.println("getname() length = " + this.myContacts.get(j).getName().length());
- if (this.myContacts.get(j).getName().trim() == name.trim()) {
- System.out.println("Found SOME record...");
- } else {
- System.out.println("NO MATCH");
- }
- }
- }
- getname() = Jon
- getname() length = 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement