String str3 = new String("Java");String str4 = new String("Java");boolean b3 = str3 == str4;System.out.println(b3);执行上述程序段,输出 。
举一反三
- 声明一个有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();
- 对于以下代码,表达式的值为true的是String str1="java";String str2="java";String str3=new String("java");StringBuffer str4=new StringBuffer("java"); A: str1==str2 B: str1==str4 C: str1==str3 D: str3==str4
- 对于下列代码:String str1=”java”;String str2=”java”;String str3=new String(”java”);StringBuffer str4=new StringBuffer (”java”);以下表达式的值为true的是 A: str1==str2; B: str1==str4; C: str2==str3; D: str3==str4;
- 现有:String str1="Java"; String str2=new String("Java"); String str3="Java"; String str4=new String("Java"); 在下列表达式中,结果为true的有
- public class Example { String str = new String("Java"); StringBuffer sb = new StringBuffer("C#"); public void strcat(String str, StringBuffer sb) { str = str + " study"; sb = sb.append(" exam"); } public static void main(String args[]) { Example ex = new Example(); ex.strcat(ex.str, ex.sb); System.out.println(ex.str); System.out.println(ex.sb); }}程序的输出结果是:______