ichi
Newbie level 1
can i kno w what's the problem with this code,,,
public class clone{
static int[][] cloneArray(int source[][]){
int[][] x;
for(i=0;i<source.length;i++) {
for(j=0;j<source.length;j++) {
int x[j]=source[j];
}
return x;
}
public static void main(String args[]) {
int source[][]={{1,2,3},{3,4,5},{5,6,7}};
int receiver[][];
receiver=cloneArray(source);
for(i=0;i<receiver.length;i++) {
for(j=0;j<receiver.length;j++) {
System.out.println(receiver[j]);
}
}
}
}
i can't use clone implementation i have to make my own algorithm,,, now what's the problem with these one??
public class clone{
static int[][] cloneArray(int source[][]){
int[][] x;
for(i=0;i<source.length;i++) {
for(j=0;j<source.length;j++) {
int x[j]=source[j];
}
return x;
}
public static void main(String args[]) {
int source[][]={{1,2,3},{3,4,5},{5,6,7}};
int receiver[][];
receiver=cloneArray(source);
for(i=0;i<receiver.length;i++) {
for(j=0;j<receiver.length;j++) {
System.out.println(receiver[j]);
}
}
}
}
i can't use clone implementation i have to make my own algorithm,,, now what's the problem with these one??