Java: Using variables in the same package across different classes
<p>I'm trying to use the same variable across two different classes but I can't seem to do it. In one class I have</p>

<pre><code>public class Ant {
private int IPos;
private int JPos;
private Direction direction;


public Ant(int iPos, int jPos, Direction direction){

    this.IPos = iPos;
    this.JPos = jPos;
    this.direction = direction;
.
.
.
</code></pre>

<p>with the required getters and setters . In another I have:</p>

<pre><code>public class Simulation {
.
.
.

public Ant cloneCurrentAnt() {  
    Ant  cloneCurrentAnt = new Ant(this.IPos, this.JPos, this.direction);
    return cloneCurrentAnt;     

}
}
</code></pre>

<p>Both files are in the same package.</p>

<p>How do I go about this?</p>

<p>Thanks</p>
