Advertisement
mmayoub

collections, Phone Book Tester

Aug 17th, 2017
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.30 KB | None | 0 0
  1. Tester.java
  2. =============================================================================
  3.  
  4. package Tester;
  5.  
  6. import PhonePkg.PhoneBook;
  7.  
  8. public class Tester {
  9.  
  10.     public static void main(String[] args) {
  11.         PhoneBook myBook = new PhoneBook();
  12.  
  13.         myBook.addPhone("Lolo", "0501231231");
  14.         myBook.addPhone("  koko  ", "039638527");
  15.         myBook.addPhone("koko", "0521234567");
  16.         myBook.addPhone("   joo joo  ", "9111369");
  17.         myBook.addPhone("KOKO  ", "+972543697415");
  18.         myBook.addPhone("lolo", "+972543697415");
  19.         myBook.addPhone("MoMoMo", "+972543697415");
  20.         myBook.addPhone("#23Mama", "+972772351698");
  21.         myBook.addPhone("77", "049996663");
  22.  
  23.         System.out.println("\nAll records in my Book:\n" + myBook);
  24.  
  25.         System.out.println("LOLO is exist?  --> " + myBook.isExist("LOLO"));
  26.         System.out.println("joo is exist?  --> " + myBook.isExist("joo"));
  27.         System.out.println("koko Phones --> " + myBook.getPhonesOf("  koKO  "));
  28.  
  29.         System.out.println("remove number a from joo joo --> "
  30.                 + myBook.removePhone("joo joo", "9111369"));
  31.         System.out.println("remove a number from koko --> "
  32.                 + myBook.removePhone("koko", "039638527"));
  33.  
  34.         System.out.println("\nAfter delete my book Is:" + myBook);
  35.  
  36.         myBook.getPhonesOf("lolo").clear();
  37.         System.out.println("lolo Phones --> " + myBook.getPhonesOf("lolo"));
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement