title: Why instance variable to be final?
body: <p>I read <a href="https://stackoverflow.com/questions/12306651/why-would-one-declare-an-immutable-class-final-in-java">this question</a> about immutable objects and was left with a question regarding immutable objects and final field:   </p>
  
  <p>Why do we need instance variable in immutable class to be final?</p>
  
  <p>For example, consider this immutable class:</p>
  
  <pre><code>public final class Immutable 
  
  {
  
    private final int someVal;
  
    public Immutable(int someVal)
   {
  
      this.someVal= someVal;
    }
  
    public int getVal() {
  
      return val;
  }
  
  }
  </code></pre>
  
  <p>If in the above code there is no set methods and the instance variable is set only within the constructor, why is it required that the instance variable is declared final?</p>