title: Objects and ArrayLists
body: <p>So rather than describe what I have tried, I will just simply lay out what I am trying to do, as every method thus far has failed me, and I am sure it is something simple I am missing.</p>
  
  <p>What I need to do is make an array of objects. Whether it is an arraylist that holds objects, or an object array that holds objects I do not care.</p>
  
  <p>I have to make a banking program, I have 8 data fields, each set makes up an account and thus an object. I first add all 8 data fields into an object, then I have been adding that object to either an arraylist or array of objects.</p>
  
  <p>My issue, is when I try to recall a specific account. Let's say I call up the arraylist or object array, when I try to call the original objects within either of those, they are empty or incompatible. It's almost as if the data just getting mushed together.</p>
  
  <p>here is some code I have to help explain.</p>
  
  <pre><code>static ArrayList AccountList = new ArrayList();
      static Object[] User = new Object[8];
  </code></pre>
  
  <p>where I add the data into the object User</p>
  
  <pre><code>type = AddAccount.jComboBox1.getSelectedItem().toString();
      User[0] = type;
      number = AddAccount.jTextField1.getText();
      User[1] = number;
      owner = AddAccount.jTextField2.getText();
      User[2] = owner;
      date = AddAccount.jTextField3.getText();
      User[3] = date;
      balance = AddAccount.jTextField4.getText();
      User[4] = balance;
      fee = AddAccount.jTextField5.getText();
      User[5] = fee;
      rate = AddAccount.jTextField6.getText();
      User[6] = rate;
      minBalance = AddAccount.jTextField7.getText();
      User[7] = minBalance;
         AccountList.add(counter,User);
      counter++;
  </code></pre>
  
  <p>I call the following when I want data, int selection is just referring the object I want</p>
  
  <pre><code> public static void displayData(int selection) {
              int row = selection;
              Object temp = AccountList.get(selection);
              System.out.println(temp[0].toString); //&lt;--WHY WONT THAT WORK?
  
          }
  </code></pre>
  
  <p>Any help appreciated, or alternative methods.</p>