Copy a string: Difference between revisions

Content deleted Content added
Warning about comparing strings
→‎[[Java]]: Changed example so it shows aliasing and fixed a typo in it.
Line 134:
[[Category:Java]]
String src = "Hello";
String dstnewAlias = new String(s)src;
String strCopy = new String(src);
//"newAlias == src" is true
//"strCopy == src" is false
//"strCopy.equals(src)" is true
 
==[[JavaScript]]==