title: A class that only has static data and methods to access these data. How to implement that properly?
body: <p>I know that is a beginner's question. I'm new to java and and also to programming in general.</p>
  
  <p>Say I got a class that has only static data, example:</p>
  
  <pre><code>class Foo {
  private static int x;  }
  </code></pre>
  
  <p>I want to use the class without instantiating any object. So I want to be able to do:</p>
  
  <pre><code>Foo.setX(5);
  Foo.getX();
  </code></pre>
  
  <p>What is the best way to implement this class, I'm a little bit confused about interfaces and other stuff for now.</p>
  
  <p>Thanks.</p>