title: JAVA Assignment & Operators
body: <p>the code below is printing out <strong>15 15</strong>, however I was expecting it to print out <strong>12 15</strong>. It seems like the fix method is updating a1 so that it contains 3,7,5 as opposed to 3,4,5. Anyone know why this is the case?</p>
  
  <pre><code>class PassA 
  {
      public static void main(String [] args) 
  {
      PassA p = new PassA();
      p.start();
  }
  
  void start() 
  {
      long [] a1 = {3,4,5};
      long [] a2 = fix(a1);
      System.out.print(a1[0] + a1[1] + a1[2] + " ");
      System.out.println(a2[0] + a2[1] + a2[2]);
  }
  
  long [] fix(long [] a3) 
  {
      a3[1] = 7;
      return a3;
  }
  }
  </code></pre>