public static int[] copy(int[] arr){
  if (arr == null) {
    return null;
  }
  int[] copy=new int[arr.length];
  System.arraycopy(arr,0,copy,0,arr.length);
  return copy;
}

public static int [ ] copy ( int [ ] arr ) { if ( arr == null ) { return null ; } int [ ] copy = new int [ arr . length ] ; System . arraycopy ( arr , 0 , copy , 0 , arr . length ) ; return copy ; }
copies a 2d double arr .
