title: How to store an object in to a variable
body: <p>I am a beginner in JAVA and I could use some help. So I have 3 classes : Client,BankAccount and Test. I need to add into a Client object the details from a BankAccount. This is the code:</p>
  
  <pre><code>public class Client {
      private String name;
      private String adress;
      private BankAccount accounts[];
  
      public Client(String name,String adress,BankAccount accounts){
          this.name=name;
          this.adress=adress;
          this.accounts=accounts;
  
      }
  
  public class BankAccount {
      private String numarCont;
      private float suma;
  
      public ContBancar(String accNumber,float sum){
          this.accNumber=accNumber;
          this.sum=sum;
      }
  
      public class Test {
          public static void main(String[] args) {
              Bankaccount b=new Bankaccount("f211s1",200);
              Bankaccount b1=new Bankaccount("f23131EUR",5000);
              System.out.println(b);
              Client c=new Client("John","142VineYard",b);
              System.out.println(c);
          }
      }
  </code></pre>
  
  <p>A client can have multiple accounts. The problem is that I don't know how can I add the details of object b into object c.</p>