title: Java - The left-hand side of an assignment must be a variable
body: <p>I'm trying to make a small program that locates different cities as my first Java project.</p>
  
  <p>I want to access the variables of my class 'GPS' from the class 'City' but I keep getting this error: The left-hand side of an assignment must be a variable. Anyone can explain to me what am I am doing wrong here and how to avoid such mistake in the future?</p>
  
  <pre><code>public class Gps {
    private int x;
    private int y;
    private int z;
  
     public int getX() {
      return this.x; 
     }
  
     public int getY() {
      return this.y; 
     }
  
     public int getZ() {
      return this.z; 
     }
  }
  </code></pre>
  
  <p>(I want to leave the variables as private)</p>
  
  <p>And this class 'Citiy' should have the coordinates:</p>
  
  <pre><code>class City {
    Gps where;
  
     Location(int x, int y, int z) {
       where.getX() = x;
       where.getY() = y;    //The Error Here
       where.getZ() = z;
     }
  }
  </code></pre>