对于引用数据类型String str1 = new String("1");String str2 = new String("1");System.out.print(str1.equals(str2));运行结果是()
A: true
B: false
C: 1
D: 程序报错,不能运行
A: true
B: false
C: 1
D: 程序报错,不能运行
举一反三
- 中国大学MOOC: 以下代码片断运行结果为:String str1=new String(Hello);String str2=new String(Hello);System.out.println(str1.equals(str2));
- 声明一个有3个元素的String类型的数组,不正确的是 A: String[] str = new String[3]; B: String str[] = new String[3]; C: String [] str = new String[3]; D: String[3] str = new String();
- String str1 = new String("ABC");String str2 = new String("ABC");str1 == str2 的值是True还是False呢?
- 下列关于字符串的声明,错误的是( )。 A: String str = new String[5]; B: String str; C: String str="abc"; D: String str=new String("abc");
- String str="i"与 String str=new String("i")一样吗?