title: Overriding interface's variable?
body: <p>As I read from various Java book and tutorials, variables declared in a interface are constants and can't be overridden.</p>
  
  <p>I made a simple code to test it</p>
  
  <pre><code>interface A_INTERFACE
  { 
      int var=100; 
  }
  
  class A_CLASS implements A_INTERFACE
  { 
      int var=99; 
      //test
      void printx()
      {
          System.out.println("var = " + var);
      }
  }
  
  class hello
  {
  
      public static void main(String[] args)
      {
          new A_CLASS().printx();
      }
  }
  </code></pre>
  
  <p>and it prints out
  var = 99</p>
  
  <p>Is var get overridden? I am totally confused. Thank you for any suggestions!</p>
  
  <hr>
  
  <p>Thank you very much everyone! I am pretty new to this interface thing. "Shadow" is the key word to understand this. I look up the related materials and understand it now.</p>