title: Why do some developers declare String objects in their Interfaces in Java, and how does it work?
body: <p>When I was analysing a code in my project, I came accross this situation.
  I have got an Interface with complete String constants declaration as below</p>
  
  <pre><code>public interface SampleInterface {
      String EXAMPLE_ONE = "exampleOne";
      String USER_ID     = "userId";
  
      public void setValue();
  }
  </code></pre>
  
  <p>If any class implements this <code>SampleInterface</code> interface, what happens to the variables it declares?</p>
  
  <ul>
  <li>Does the inherited class get access to all the variables?</li>
  <li>Does the implemented class needs to override the declarations?</li>
  <li>What might be the purpose of declaring the String variables in an interface, when we could use an abstract class for this purpose?</li>
  </ul>
  
  <p>Also, what is the best strategy:</p>
  
  <ol>
  <li>A class with the final static fields and a private constructor?</li>
  <li>An Interface with the variables as seen above?</li>
  </ol>