title: Issue when manipulating index values within an array in java
body: <p>This piece of code asks a user to input 4 songs then asks how many downloads they each got then outputs the arrays, along with the most downloaded track and the total downloads of the 4 combined tracks. </p>
  
  <p>When manipulating the second index of  the arraay(total downloads) an error occurs. Also when outputting the most downloaded tracks it loops and outputs differenet results when the output is outside the for loop. An example of the error would be;</p>
  
  <p>The most downloaded track is See you again</p>
  
  <p>The most downloaded track is Forget you</p>
  
  <p>The most downloaded track is Forget you</p>
  
  <p>When the actual most downloaded track is Forget you.</p>
  
  <p>It also doesnt allow the totalDownloads to be manipulated:</p>
  
  <p>If the tracks have 3000, 2000, 5000, 8000 downloads respectively.  </p>
  
  <p>it would turn the total into 3000200050008000. I understand this is because im adding string values but when I try to convert them into integers an error occurs</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.Arrays;
  
  public class arrays{
  
    public static void main(String args[]){
  
      String[][] array = new String[4][2];
      Scanner sc = new Scanner(System.in);
      Int totalDownloads;
  
      for (int i = 0; i &lt; 4; i++) {
  
          System.out.println("What is track " + (i + 1));
          array[i][0] = sc.nextLine();
          System.out.println("How many thousands of times has it been downloaded? ");
          array[i][1] = Integer.parseInt(sc.nextInt() * 1000);
          totalDownloads = totalDownloads + array[i][1];
  
      }
  
      sc.close();
  
      String mostDownloads = "";
  
      for (int i = 1; i &lt; 5; i++) {
          if(Integer.parseInt(array[1][1]) &gt;= Integer.parseInt(array[i][1])){
             mostDownloads = array[1][0];
          } else if(Integer.parseInt(array[2][1]) &gt;= Integer.parseInt(array[i][1])) {
                mostDownloads = array[2][0];
          } else if(Integer.parseInt(array[3][1]) &gt;= Integer.parseInt(array[i][1])) {
                mostDownloads = array[3][0];
          } else if(Integer.parseInt(array[4][1]) &gt;= Integer.parseInt(array[1][1])) {
                mostDownloads = array[4][0];
  
  
  
  }
  
      System.out.println("The track downloaded the most is " +mostDownloads);
      System.out.println("The total number of downloads of these 4 tracks was " + totalDownloads + "000");
      System.out.println("The details of the downloads are");
      System.out.println(Arrays.toString(array[0]));
      System.out.println(Arrays.toString(array[1]));
      System.out.println(Arrays.toString(array[2]));
      System.out.println(Arrays.toString(array[3]));
  }
  
  }
  }
  </code></pre>