Back to notes -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'  Slide program -- Keyboard shortcut: 't'    The class PersonAccountPair.Lecture 5 - slide 15 : 29
Program 3
using System;

public class PersonAccountPair{     
                                    
  private Person person;            
  private BankAccount bankAccount;  

  public PersonAccountPair(Person person, BankAccount bankAccount){
    this.person = person;
    this.bankAccount = bankAccount;
  }
 
  public BankAccount Account {
    get {return bankAccount;}
    set {bankAccount = value;}
  }

  public Person Person {
    get {return person;}
    set {person = value;}
  }

}
 
 
A very simple aggregation of a Person
and his/her BankAccount. In real life
we would program such a Pair generically:
Pair<Person, BankAccount>.