title: Java: Storing Objects within an Array of objects
body: <p>Let's say I have an array of Clients.
  Each and every Client stores three objects within them, so for example
  Client[1] has a <code>CurrentAccount</code>, <code>CreditCard</code>, <code>DebitCard</code> class.</p>
  
  <p>How would I go about creating a database like this?
  let's say <code>CurrentAccount</code> has a public method "<code>getAmount</code>"
  would it work if I called:</p>
  
  <pre><code>int num = Client[1].CurrentAccount.getAmount();
  </code></pre>
  
  <p>Im pretty sure it wouldn't. But then how do you create this database?</p>