title: Why can final constants in Java be overridden?
body: <p>Consider the following interface in Java:</p>
  
  <pre><code>public interface I {
      public final String KEY = "a";
  }
  </code></pre>
  
  <p>And the following class:</p>
  
  <pre><code>public class A implements I {
      public String KEY = "b";
  
      public String getKey() {
          return KEY;
      }
  }
  </code></pre>
  
  <p>Why is it possible for class A to come along and override interface I's final constant?</p>
  
  <p>Try for yourself:</p>
  
  <pre><code>A a = new A();
  String s = a.getKey(); // returns "b"!!!
  </code></pre>