//字符串概述 public class test40 { public static void main ( String [] args ){ char [] str1 = { '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' }; String str2 = new String ( "我是歌谣" ); String str3 = new String ( str1 ); Stri
//字符串概述
public class test40 {
public static void main(String[] args){
char[] str1={'1','2','3','4','5','6','7','8','9'};
String str2=new String("我是歌谣");
String str3=new String(str1);
String str4=new String(str1,3,4);
String str5=new String("\"\\");
System.out.println(str2);
System.out.println(str3);
System.out.println(str4);
System.out.println(str5);
}
}
运行结果