Mag
Originally posted by brent spearios:
Thanks, the real problem was what is the point of using clone when you could do a =, i know that it creates a new object when you use clone but what other benefit is there for clone() ?
Originally posted by brent spearios:
Can someone explain why the value printed out is always no
and also false
class h{
public static void main(String args[]){
String i[][]={ {"hello","world","how"}, new String[7]};
String h[][]=i;
String b[][]=(String [][]) i.clone();
i[0][0]="no";
System.out.println (b[0][0]);
System.out.println (h[0][0]);
//b[1][3]=i[0].length;
//System.out.println (i[0][0]);
System.out.println (b[1][3]);
System.out.println (b[0][0].equals (i[0][0]));
//System.out.println (i[1][2]);
}
}
Originally posted by brent spearios:
Can someone explain why the value printed out is always no
and also false
class h{
public static void main(String args[]){
String i[][]={ {"hello","world","how"}, new String[7]};
String h[][]=i;
String b[][]=(String [][]) i.clone();
i[0][0]="no";
System.out.println (b[0][0]);
System.out.println (h[0][0]);
//b[1][3]=i[0].length;
//System.out.println (i[0][0]);
System.out.println (b[1][3]);
System.out.println (b[0][0].equals (i[0][0]));
//System.out.println (i[1][2]);
}
}
Don't get me started about those stupid light bulbs. |