title: How to use values from another class
body: <p>I would like to have a class or whatever else is better where I store constant values that I want to use in other classes.</p>
  
  <p>For example, I would like to have a class named A which looks like</p>
  
  <pre><code>public class A
  {
    public int x = 1;
  }
  </code></pre>
  
  <p>and in another class I would like to use that value in a method:</p>
  
  <pre><code>class B
  {
    public void test()
    {
      int y = A.x;
    }
  }
  </code></pre>
  
  <p>I know this is wrong, it's just an example of what I would like to use. It's probably a basic question but I don't have much experience with programming.</p>