title: Copying a Boolean array on Java
body: <p>I'm trying to copy a Boolean array into another boolean array. This is that I'm trying: </p>
  
  <pre><code>public class Nucleo {
  private boolean[] nivel;
  
  public Nucleo(boolean[] carga, double x, int i){ //Copy the array
      for(int j=0; j&lt;carga.length; j++){ 
          nivel[j]=carga[j];
      }
  
      x=potencia;
      i=porcentaje;
  
  }
  </code></pre>
  
  <p>I send the array <code>boolean[] carga</code> from the <code>main</code>. Like this: </p>
  
  <pre><code>    public static void main(String[] args) {
      // TODO Auto-generated method stub
      boolean[] niveles = new boolean[8];
      rellniveles(niveles);
      Nucleo nivel1= new Nucleo(niveles, 5, 4);
      nivel1.getPotencia();
  }
  
  public static void rellniveles(boolean[] niv){ //Fill the array
      niv[0]=true;
      niv[1]=true;
      niv[2]=true;
      niv[3]=true;
      niv[4]=true;
      niv[5]=true;
      niv[6]=false;
      niv[7]=false;
  
  }
  </code></pre>
  
  <p>If I try to copy with <code>"System.arraycopy( carga, 0, nivel, 0, carga.length );"</code></p>
  
  <p>I get the error: <code>"Source not found".</code></p>
  
  <p>I'm using Eclipse. I get this error with System.arraycopy() i.imgur.com/pbGrKz6.png </p>