title: Method modifies method out of scope
body: <p>i have a very funny issue today. I am trying to modify an array but method modifies another array on which is not even call upon.</p>
  
  <p>a)Part of method which is causing troubles</p>
  
  <pre><code>public static void place2(String output, int position,furniture furniture_array[], char room_grid[][]) {
  
      int i=0;
      int j=0;
  
      furniture_array[position].setXY(i, j);
      char grid1[][] = room_grid;
      char grid2[][] = room_grid;
      char grid3[][] = room_grid;
      char grid4[][] = room_grid;
      pasteToArray(i, j, grid1, furniture_array[position]);
  }
  </code></pre>
  
  <p>b)pasteToArray</p>
  
  <p>This is really simple method which recieves input_array and in this array it will past array which is an object value.</p>
  
  <pre><code>public static char[][] pasteToArray(
      int x, int y, char input_array[][], furniture furniture_to_be_placed) {
  
      char[][] result=input_array;
  
      for (int i = 0; i &lt;= furniture_to_be_placed.getSize(); i++) {
          for (int j = 0; j &lt;= furniture_to_be_placed.getSize(); j++) {
              result[x + i][y + j] = furniture_to_be_placed.furn_grid[i][j];
          }
      }
      return result;
  }
  </code></pre>
  
  <p>What is my question?</p>
  
  <ol>
  <li>Why the method with input A,B and result C modifies D? ( relative names )</li>
  </ol>
  
  <p>What I've already done to solve it myself: -</p>
  
  <ol>
  <li>Debug code - Found a method which is causing problems </li>
  <li>Helpless cry for 25 minutes includes swearing</li>
  <li>Checked for global variables</li>
  <li>Rename all methods inputs to relative neutral names </li>
  </ol>
  
  <p>Can anyone help me out of this?</p>