String、StringBuffer、StringBuilder的区别?
相似题目
-
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()
-
以下语句的含义是() char[] arrcrlf={13,10}; String crlf=new String(arrcrlf); stringBuffer dest = new StringBuffer("西行漫记"); dest.append(crlf);
-
Which methods from the String and StringBuffer classes modify the object on which they are called?()
-
int index = 1; String test = new String; String foo = test[index]; What is the result?()
-
Given this method in a class: public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(‟<‟); buffer.append(this.name); buffer.append(‟>‟); return buffer.toString(); } Which is true?()
-
下列关于String类和stringBuffer类说法正确的有()。
-
将一个string类对象赋予新值,应该使用string类的()函数。
-
请问如下哪些语句正确?(多选)A: String s1=”abc”; String s2=”abc”;则s1= =s2B: String[] s=”abc”;C: new String s=”abc”;D: String s=new String(“abc”);
-
StringBuffer和String属于不同的类型,不能直接进行强制类型转换( )
-
测试如下代码:public class Ref{public static void main(String[] args) {StringBuffer sbl = new StringBuffer(Hello);StringBuffer sb2 = new StringBuffer(Hello);boolean result = sbl.equals(sb2);System.out.println(result);}}下述哪条语句正确描述了程序编译和运行的行为?
-
下面程序的运行结果是_________ String s1 = new String( “abc”); String s2 = new String( “abc”); System.out.println(s1==s2); String s3 = “ 你好吗 ”; String s4 = ” 你”; String s5 = ” 好吗 ”; System.out.println( “ 你好吗 ”==(”你”+”好吗 ”)) ;
-
测试如下代码: public class Ref{ public static void main(String[] args) { StringBuffer sbl = new StringBuffer(\Hello\); StringBuffer sb2 = new StringBuffer(\Hello\); boolean result = sbl.equals(sb2); System.out.println(result); } } 下述哪条语句正确描述了程序编译和运行的行为?
-
处理字符串运行速度快慢为:StringBuilder > StringBuffer > String ( )
-
先阅读下面的程序片段:String str1=new String(\java\);String str2=new String(\java\);StringBuffer str3=new StringBuffer(\java\);对于上述定义的变量,以下表达式的值为true的是哪个?( )
-
执行下面的代码会引发()异常。 String str = null; String strTest = new String(str);
-
执行下面代码后,( )结论是正确的. String[] s=new String[10];
-
String s = new String("xyz"),以下( )语句将改变s的值。
-
在某类的公共部分有声明string operator++();和string operator++(int);则说明A.string operator
-
下列的哪个程序段可能导致错误?()A.String s="hello"; String t="good"; String k=s+t;B.String
-
String s = new String();创建了几个String Object()
-
执行”String[] s = new String[10];”语句后,结论正确的是()
-
var a_number=100;var a_string=new String(a_number);a_string.mystr=”javascript”;alert(a_string.mystr);
-
StringBuffer str=new StringBuffer(25);String s=”Hello”,若执行语句str.append(s)后,str.length()和str.capacity()的返回值为()。
-
下面是一段javabean程序,该程序的运行结果是 () 。public class NullTest { public static void main(String[] ?args) { int M = 0; String str = null; StringBuffer sb = new StringBuffer("= "); sb.append(str); sb.ap