title: II tried to set a value using a different method, but I got compiler errors
body: <p>This is my code:</p>
  
  <pre><code>public class Point3D {    
      public static void main(String args[]) {    
          int x=setX(x);
          System.out.println(x);
      }
      int x=1;
      public int setX(int x) { 
          this.x=x;
      }   
  }
  </code></pre>
  
  <p>The compiler(cmd) showed the following errors:</p>
  
  <pre><code>Point3D.java:5: error: non-static method setX(int) cannot be referenced from 
  static context int x=setX(x);
    ^
  1 error
  </code></pre>
  
  <p>Can anyone please help me fix this?</p>