title: How Do I Add Two Separate Objects in an Array Without Using an ArrayList?
body: <p>One of my objects is a randomly generated number. The other object is derived from using System.nanoTime(). I need to log the time the random number was generated and then store them in an array. I created an addTo method in my storage class. I am calling it from main after I call the methods to generate random number and the time, but I keep getting an error (Storage@1948cc8c). I'm not sure if the number and time I get are even being stored. </p>
  
  <pre><code>public class Driver 
  {
  static MyNum number = new MyNum();
  static int numStore;
  static Time time = new Time();
  static long timeStore;
  static Storage storage = new Storage(50);
  
  public static void main (String [] args)
  {
      for (int i = 0; i &lt; 50; i++)
      {   
          System.out.println(number.myRand());
          System.out.println(time.tellTime());
          storage.addTo(number, time);
          System.out.println(storage);
      }
    }
  }
  
  
  
  public class Storage 
  {
  Node[] id;
  private int count;
  private MyNum m;
  private Node n;
  
  public Storage(int size)
  {
      id = new Node [size];
      count = 0;
  }
  
  public void addTo(MyNum number, Time time)
  {
      int size = 0;
      for(count=0;count&lt;id.length;count++)
  
          id[size] = new Node(number, time);
  
     }
  }
  </code></pre>