Question: /* APCSA Ch85pg28: Phone Book Array List 20230206 Modify the program so that it searches for a name entered by the user. Test, change, play
/* APCSA Ch85pg28: Phone Book Array List 20230206 Modify the program so that it searches for a name entered by the user. Test, change, play with code. Know all the concepts, be able to clearly explain each part and each line! */ import java.util.* ; public class Ch85pg28_PhoneBook_STU2a { public static void main ( String[] args) { ArrayList
public Entry( String n, String num ) { name = n; number = num; } // methods public String getName() { return name ; } public String getNumber() { return number ; } public boolean equals( Object other ) { System.out.print (" Compare " + other + " To " + this ); System.out.println(" Result: " + name.equals( ((Entry)other).name ) ); return getName().equals( ((Entry)other).getName() ); } public String toString() { return "Name: " + getName() + "; Number: " + getNumber() ; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
