String b = new String("my string");
String a="my string";
String c="my string";
String d = new String("my string");
String e = b; System.out.print(a==c);//true
System.out.print(b==d);//false
System.out.print(a==b);//false
System.out.print(e==b);//true
char[] chrCharArray; //创建一个字符数组
chrCharArray chrCharArray = a.toCharArray(); //将字符串变量转换为字符数组
for(char s:chrCharArray){
System.out.println(s);
}
String k= String.valueOf(chrCharArray ); //将字符数组转换为字符串
System.out.print(k);