title: Two dimensional array with different row length. I need to drop min, max and calculate the average for each line in Java
body: <pre><code>public class Average {
  static int[][] myDouble = new int[10][12];
  static int x = 0, y = 0;
  static int strDouble;
  
  public Average() {
      try {
          BufferedReader in = new BufferedReader(new FileReader("StudentIdAverage.txt"));
          String line;
          while ((line = in.readLine()) != null) {
              String[] values = line.split("\\s+");
  
              for (String str : values) {
                  strDouble = Integer.parseInt(str);
                  myDouble[x][y] = strDouble;
                  y = y + 1;
              }
              x = x + 1;
              y = 0;
          }
          in.close();
      } catch (IOException ioException) {
      }
  }
  
  public static void main(String[] args) {
  
      Average arr = new Average();
      //int[][] residuescores = arr.myDouble;
      for (int i = 0; i &lt; myDouble.length; ++i) {
           int sum = 0;
           int average = 0;
          for (int j = 0; j &lt; myDouble[i].length; ++j) {
              Arrays.sort(myDouble[i]);
              sum+=myDouble[i][j];
              System.out.print(Average.myDouble[i][j] + " ");
          }
          average = (sum/myDouble[i].length);
  
          System.out.println(" ");
          System.out.println(average);
      }
  
  }
  }
  </code></pre>
  
  <p><strong>input File:-</strong></p>
  
  <blockquote>
    <p>45 72 90 50 67 63 81 71 55 56 80 74/n 55 54 79 72 75 68/n 51 88 79
    72/n 98 52 52 53 50 92 67 99 92 50 61 91/n 94 48 53 92 97/n 97 69 77
    74 68 54 87 74 54 83 58 69/n 75 49 87 61 66 53 79 48 96 60/n 58 71 51
    73 53 75 93 81 45 69 78 65/n 50 88 78 81 99 61 97 70 87 80 69/n 91 89
    97 80 93 82 92 49 52 69 96 61 </p>
  </blockquote>