title: Main and objects,Java
body: <p>I have a noob questions,s orry for wasting your time but could somebody explain?</p>
  
  <pre><code>public class Ex {
      public  int a = 0;
      public Ex(int x){
              a = x;
          int y = 10;
      }
  
  
      public static void main(String[] args){
          Ex obj = new Ex(10);
          System.out.println(Ex.a);   
      }
  }
  </code></pre>
  
  <p>Why isn't this working? I tried to put constructor in main but that ain't working either.</p>