title: final int in Java
body: <p>I have a relatively simple question regarding the function of <code>final</code> in Java.
  When I compile this code:</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.util.*;
  import java.lang.*;
  import java.io.*;
  
  
  class Arrays
  {
   public static void main (String[] args) throws java.lang.Exception
   {
  final int[] myArray = { 1,2 }; 
  myArray[1] = 3; 
  System.out.println (myArray[1]);  
   }
  }
  </code></pre>
  
  <p>The number "3" gets printed. However, I was under the impression that <code>final</code> meant that the values held in that array (myArray) can no longer change and are constant. </p>
  
  <p>There is also another piece of code here:</p>
  
  <pre><code>final int [] a1 = {1, 2}; 
  int [] b1 = {3, 4};
  a1 = b1; System.out.println (a1[1]);
  </code></pre>
  
  <p>I believe that the system should print "2" since <code>a1</code> is finalized and the values in the array are constant. However, my friend believes that it should be "4". Please help me clear up my understanding of <code>final</code>. </p>