hi ^_^
I want to ask what is the difference between (System.out.println(B);) and (System.out.println(new string(B));) ?!
actually it gives me the same output in my code!
so then >>what is the use of [new string(array)] in general ???
thank U :)))
public class CopyArray {
public static void main(String[] args) {
char A[]={'j','a','v','a'};
char B[] =new char [4];
System.arraycopy(A, 0, B,0, 4 );
System.out.println(B);
}
}
---------------------------------------------------------------
public class CopyArray {
public static void main(String[] args) {
char A[]={'j','a','v','a'};
char B[] =new char [4];
System.arraycopy(A, 0, B,0, 4 );
System.out.println(new string(B));
}
}