title: How to access an object from a different class and package?
body: <p>So, I am a learning programmer and I started to learn Java 2 months ago as a course at my university. I really like to program in my spare time and I'm currently trying to make a game. There is one problem at the moment which I just can't solve.</p>
  
  <p>I have a class called Move, and I declare in my class called Start:
  Move move1 = new Move();</p>
  
  <p>Now when I'm back in my Move class, I would like to access this move1 but it doesn't let me. It says:classname cannot be resolved.</p>
  
  <p>To clarify:</p>
  
  <pre><code>public class Move {
      private String s = null;
      public void setName(String s) {
         name = s;
      }
      public String getName() {
      return name;
      }
      public void setList() {
      System.out.println(move1.getName() + move2.getName()); // This won't work
      }
  }
  </code></pre>
  
  <p>And the start class:</p>
  
  <pre><code>public class Start {
     public static void main(String[] args) {
        Move move1 = new Move();
        Move move2 = new Move();
        move1.setName(kick);
        move2.setName(punch);
     }
  }
  </code></pre>
  
  <p>It would be awesome if someone could help me out!</p>
  
  <p>-edit</p>
  
  <p>OK! I got a few reactions but I didn't really get the answer I need. I know now i can use <code>this</code> instead of the object name but what if I want to use a second object? I changed code the above.</p>