title: Multi arraylist, trying to store timestamp with data
body: <p>We have the code below which is a simple loop iterating through an arraylist and storing  each iterated value into another arraylist. Each time an iteration is achieved,  a timestamp value is obtained. How do we create or change the existing arrylist to store both a value and a timestamp together. Can we create a multi dimentional arraylist to do this ie arraylist [0],[0]. if so how?</p>
  
  <pre><code> int counter = 0; //current number of iterations
   ArrayList&lt;String&gt; logData = new ArrayList&lt;String&gt;();
  
   while (counter &lt; TemData.size()) {
  
       Thread.sleep(5000); // Sleep for 5000 milliseconds (5 seconds)
       nowTime = new GetCurrentTimeStamp(); 
  
       logData.add((String) TemData.get(counter));
  
       System.out.println();
       System.out.println("Outputting Array Data &gt;&gt; " + logData.get(counter));
  
       //add to timestamp ArrayList
       nowTime = new GetCurrentTimeStamp();
  
       counter++; //increment counter)
  }
  </code></pre>
  
  <p>This is GetCurrentTimeStamp class</p>
  
  <pre><code>public class GetCurrentTimeStamp {
  public GetCurrentTimeStamp()
  public GetCurrentTimeStamp() {
       //Date object
       Date date= new Date();
       //getTime() returns current time in milliseconds
       long time = date.getTime();
       //Passed the milliseconds to constructor of Timestamp class 
       Timestamp ts = new Timestamp(time);
       System.out.println("Time Stamp &gt;&gt; "+ts);
      }  
  }
  </code></pre>