title: Make a group of variables public in java
body: <p>Is there an easy way to make a group of variables in a class as public. For example to make a group of variables as static, I can use something like below.</p>
  
  <pre><code>class A {
      static {
          int x;
          int y;
      }
  }
  </code></pre>
  
  <p>Is there a way to do something similar to make the variables as public. Something like this.  </p>
  
  <pre><code>public {
          int x;
          int y;
          }
  </code></pre>
  
  <h2>Edit:</h2>
  
  <p>I understood that the static block doesn't do what I supposed it will do. What I need is a java version of something like this in C++</p>
  
  <pre><code> class A {
        public:
            int x;
            int y;
    }
  </code></pre>