How to Manipulate 2D Array Data in Java
<p>I have a list of start and stop times for individuals doing tasks over a week.</p>

<p>When they change tasks a new entry is made.</p>

<p>This info is stored in a 2D array. - I want to loop through this Array and store the data in another array. </p>

<p>In the new 2D array I want a row to show a person on a particular day. </p>

<p>So if the first array stores: (Person,Day,In,Out,Total)</p>

<pre><code>{{"John","Mon","08:00","12:00","4.00"},
 {"John","Mon","12:00","17:00","5.00"},
 {"John","Tue","08:00","17:00","9.00"},
 {"Mike","Tue","08:00","11:00","3.00"}
 {"Mike","Tue","11:00","17:00","6.00"}};
</code></pre>

<p>I want the second array to store:</p>

<pre><code>    {{"John","Mon","08:00","17:00","9.00"},
     {"John","Tue","08:00","17:00","9.00"},
     {"Mike","Tue","08:00","17:00","9.00"}};
</code></pre>

<p>Here's my code so far:</p>

<pre><code> public class CompArrayTest {

public static void main(String args[]){

    String[][] End = new String [5][5];
    String[][] Start = {{"John","Mon","08:00","12:00","4.00"},
                        {"John","Mon","12:00","17:00","5.00"},
                        {"John","Tue","08:00","17:00","9.00"},
                        {"Mike","Tue","08:00","11:00","3.00"},
                        {"Mike","Tue","11:00","17:00","6.00"}};



    //print start 
    for(int i = 0; i&lt;Start.length; i++){ 
      for(int j = 0; j&lt;Start.length; j++){
          System.out.print(Start[i][j]+" ");

      }//j end
     System.out.print("\n");
    }//i end

    //change end 
    for(int i = 0; i&lt;Start.length; i++){ 
        String name = Start[i][0];
        String day = Start[i][1];
        String In = Start[i][2];
        String Out = Start[i][3];
        String Total = Start[i][4];

       //look through End
      for(int j = 0; j&lt;5; j++){

      String eN= End[j][0];
      String eD= End[j][1];

      if(eN==name &amp;&amp; eD==day){
      //change end time
      End[j][3]=Start[i][3];

      //parse and add times
      double TS = Double.parseDouble(Start[i][4]);
      double TE = Double.parseDouble(End[i][4]);

      double ans = TS + TE;
      String ANS = ans+"";

      End[j][4]= ANS;


      } else {



      End[j][0] = name;
      End[j][1] = day;
      End[j][2] = In;
      End[j][3] = Out;
      End[j][4] = Total;


      }//else end


      }//j end
     System.out.print("\n");
    }//i end

 //print end 
    for(int i = 0; i&lt;Start.length; i++){ 
      for(int j = 0; j&lt;Start.length; j++){
          System.out.print(End[i][j]+" ");

      }//j end 
     System.out.print("\n");
    }//i end

}//main end
</code></pre>