title: Array prints out zeros
body: <p>I have this program which gets input from user and creates the array. Then the user will also specify the values to be placed into the array. My program is able to get the input from the user and is able to print it out. But when i add extra methods which processes these inputs and returns it, the program keeps on printing out zeros. I am unable to identify the mistake in my codes. I suspect that the mistake is somewhere in the passing of the array. I want to learn from my mistake and correct it. Please help me to go through my codes and check where the mistake lies. I have included parts of my codes where i think the problem might lie. </p>
  
  <p>Thank you in advance!!!</p>
  
  <p>Code: </p>
  
  <pre><code>class Matrix {
  int size;
  int matrix[][];
  public Matrix() {}
  
  public Matrix(int matrix[][],int size) {
      this.size = size;
      this.matrix = new int[size][size];
  
  }
  
  public int [][] opt(String op, String t){
  
      if(op.equals("Reflect")){
  
          if(type.equals("x")){
              rX();
          }
  
      }
      return matrix;
  }
  
  private void rX(){
      int i;
      int j;
  
      int array[][] = new int[size][size];
  
      for (i=0; i&lt; size; i++){
          for (j=0; j &lt; size; j++){
              array[size-(i+1)][j] = matrix[i][j];
          }
         matrix = array;
  
      }
  
  class Transform {
  public static void main(String[] args) {
  
      Matrix matrix = new Matrix(tempArray, size);
      opt = sc.nextInt();
  
   for (i=0; i&lt;opt; i++){
          String op = sc.next();
          String t = sc.next();
          tempArray = matrix.opt(op,t);
  
      }
  
     }
  </code></pre>