Exemple #1
0
 public static void main(String[] args) {
   BuddyInfo Jimbo = new BuddyInfo("Jimbo", "123 Fake Street", "(555) 555-5555");
   BuddyInfo Name = new BuddyInfo();
   AddressBook buddies = new AddressBook();
   Jimbo.printName();
   Name.setName("John Doe");
   Name.setAddress("321 Faker Street");
   Name.setPhoneNumber("(613) 555-5555");
   Name.printName();
   buddies.addBuddy(Jimbo);
   buddies.addBuddy(Name);
   buddies.removeBuddy(Name);
 }
Exemple #2
0
 public static void main(String[] args) {
   BuddyInfo buddy = new BuddyInfo("tom", "Carleton", "1234");
   AddressBook ab = new AddressBook();
   ab.addBuddy(buddy);
   ab.removeBuddy(buddy);
   // changes
 }