title: Declaring object as final in java
body: <p>Can someone clarify the significance of the below code.</p>
  
  <pre><code>class A
  {
      int i = 10;
  
      public void setI(int b)
      {
          i = b;
      }
  
      public int getI()
      {
          return i;
      }
  }
  
  class Test
  {    
      public static void main(String args[]) throws Throwable
      { 
          final A ob = new A();
          ob.setI(10);
          System.out.println(ob.getI());
      }
  }
  </code></pre>
  
  <p>The object A is declared as final, but I can change value of this object's instance variable and also retrive the updated value. So what are the significance of declaring an object as final.
  I am aware about declaring primitive datatype as final, which makes that variable constant.</p>