package test01;
import java.util.Arrays;
public class test04 {
public static int [][] copy(int [][] b) {
int [][] c;
c = new int[b.length][];
for(int i=0; i<b.length; i++) c[i] = new int[b[i].length];
for(int i=0; i<b.length; i++)
for(int j=0; j<b[i].length; j++)
c[i][j] = b[i][j];
return c;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] c = {56,87,96,59,87,48,56,33,65,78};
int[] d= c.clone();
System.out.println(Arrays.toString(c));
System.out.println(Arrays.toString(d));
int [][] a = {{1,2,3},{4,5,6},{7,8,9}};
int [][] b = copy(a);
//copy() => clone()을 메소드로 만든경우
System.out.println(Arrays.deepToString(a));
System.out.println(Arrays.deepToString(b));
//b[0][0]=100;
for(int i=0; i<b.length; i++)
for(int j=0; j<b[i].length; j++)
System.out.printf("%d %d ",a[i][j], b[i][j]);
}
}