title: Java copy constructor and clone doesnt work
body: <pre><code>public class Stav implements Cloneable{
  private int[] pole;
  
  public Stav(int[] pole){
      this.pole = pole;
  }
  public Stav(Stav a){
      this.pole = a.pole;
  }
  public void move(boolean left){
      int empty = findEmpty();
      if(left){
          this.pole[empty] = this.pole[empty - 1];
          this.pole[empty - 1] = 0;
      }
      else{
          this.pole[empty] = this.pole[empty + 1];
          this.pole[empty + 1] = 0;
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Jednotka pom = fronta.remove();
  Stav nStav = new Stav(pom.getStav().getPole());
  Stav pomStav = new Stav(nStav);
  </code></pre>
  
  <p>and when i call </p>
  
  <pre><code>pomStav.move(false);
  </code></pre>
  
  <p>the value of nStav will change same as pomStav... somebody can help me with this? I have some more metods in code but its so long so I didnt copy here like findEmpty etc.</p>