title: Accessing objects of other classes
body: <p>I've recently picked up Java and have run into a problem. I have several files with different classes, but I can't figure out how I can access objects of the other classes in files other than the one they were declared in. For example:</p>
  
  <pre><code>player.java:
  public class Player 
  {
      public static void main(String[] args) {
          Player player = new Player();
      }
      public int getLocation()
      {
           return 2;
      }
  }
  
  monster.java:
  public class Monster
  {
      public void attackPlayer()
      {
          player.getLocation();
      }
  }
  </code></pre>
  
  <p>I'm not sure how I can access these objects of other classes effectively from other files and classes themselves? I know I could make the objects static and then access them as variables through the class they were made in, but that seems rather counter-intuitive? I come from a less object-oriented programming background so I'm still trying to understand java's style of programming.</p>