单选题关于String,StringBuilder以及StringBuffer,描述错误的是()。A对String对象的任何改变都不影响到原对象,相关的任何change操作都会生成新的对象BStringBuffer是线程安全CStringBuilder是线程安全D可以修改StringBuilder和StringBuffer的内容
单选题
关于String,StringBuilder以及StringBuffer,描述错误的是()。
A
对String对象的任何改变都不影响到原对象,相关的任何change操作都会生成新的对象
B
StringBuffer是线程安全
C
StringBuilder是线程安全
D
可以修改StringBuilder和StringBuffer的内容
参考解析
解析:
暂无解析
相关考题:
Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?() A.When using versions of Java technology earlier than 5.0.B.When sharing a StringBuffer among multiple threads.C.When using the java.io class StringBufferInputStream.D.When you plan to reuse the StringBuffer to build more than one string.
下列关于字符串的描叙中错误的是( )A、字符串是对象B、String对象存储字符串的效率比StringBuffer高C、可以使用StringBuffersb="这里是字符串"声明并初始化StringBuffer对象sbD、String类提供了许多用来操作字符串的方法:连接,提取,查询等
Whichtwo scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()A、When using versions of Java technology earlier than 5.0.B、When sharing a StringBuffer among multiple threads.C、When using the java.io class StringBufferInputStream.D、When you plan to reuse the StringBuffer to build more than one string.E、Enitiation of separate design processes to the separation of users
public class TestString3 { public static void main(String[] args) { // insert code here System.out.println(s); } } Which two code fragments, inserted independently at line 3, generate the output 4247?()A、 String s = “123456789”; s = (s-”123”).replace(1,3,”24”) - “89”;B、 StringBuffer s = new StringBuffer(”123456789”); s.delete(0,3).replace( 1,3, “24”).delete(4,6);C、 StringBuffer s = new StringBuffer(”123456789”); s.substring(3,6).delete( 1 ,3).insert(1, “24”);D、 StringBuilder s = new StringBuilder(”123456789”); s.substring(3,6).delete( 1 ,2).insert( 1, “24”);E、 StringBuilder s = new StringBuilder(”123456789”); s.delete(0,3).delete( 1 ,3).delete(2,5).insert( 1, “24”);
Public class test ( Public static void stringReplace (String text) ( Text = text.replace (‘j’ , ‘i’); ) public static void bufferReplace (StringBuffer text) ( text = text.append (“C”) ) public static void main (String args[]} ( String textString = new String (“java”); StringBuffer text BufferString = new StringBuffer (“java”); stringReplace (textString); BufferReplace (textBuffer); System.out.printLn (textString + textBuffer); ) ) What is the output?()
String与StringBuffer的区别()。A、String是不可变的对象,StringBuffer是可以再编辑的B、String是常量,StringBuffer是变量C、String是可变的对象,StringBuffer是不可以再编辑的D、以上说法都不正确
关于 String、StringBuffer 和 StringBuilder 说法错误的是()A、String 创建的字符串是不可变的B、StringBuffer 创建的字符串是可变的,而所引用的地址一直不变C、StringBuffer 是线程安全的,因此性能比 StringBuilder 好D、StringBuilder 没有实现线程安全,因此性能比 StringBuffer 好
String与StringBuffer最大的区别在于()A、它们没有区别B、String对原字符串的拷贝进行操作,而StringBuffer对原字符串本事操作C、StringBuffer拥有更多相关函数D、String更节省空间
关于String和StringBuffer,下面那些是正确的:()A、常量字符串使用String,非常量字符串使用StringBuffer。B、使用StringBuffer的时候设置初始容量。C、尽量使用StringTokenizer代替indexOf()和substring()。D、尽量不要使用StringBuffer,StringTokenizer类。
下列关于字符串的描叙中错误的是()。A、字符串是对象B、String对象存储字符串的效率比StringBuffer高C、可以使用StringBuffer sb="这里是字符串"声明并初始化StringBuffer对象sbD、String类提供了许多用来操作字符串的方法:连接,提取,查询等
关于String,StringBuilder以及StringBuffer,描述错误的是()。A、对String对象的任何改变都不影响到原对象,相关的任何change操作都会生成新的对象B、StringBuffer是线程安全C、StringBuilder是线程安全D、可以修改StringBuilder和StringBuffer的内容
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?() A、 This code is NOT thread-safe.B、 The programmer can replace StringBuffer with StringBuilder with no other changes.C、 This code will perform well and converting the code to use StringBuilder will not enhance the performance.D、 This code will perform poorly. For better performance, the code should be rewritten: return ““+ this.name + “”;
Which methods from the String and StringBuffer classes modify the object on which they are called?() A、The charAt() method of the String class.B、The toUpperCase() method of the String class.C、The replace() method of the String class.D、The reverse() method of the StringBuffer class.E、The length() method of the StringBuffer class.
多选题关于String和StringBuffer,下面那些是正确的:()A常量字符串使用String,非常量字符串使用StringBuffer。B使用StringBuffer的时候设置初始容量。C尽量使用StringTokenizer代替indexOf()和substring()。D尽量不要使用StringBuffer,StringTokenizer类。
单选题Which methods from the String and StringBuffer classes modify the object on which they are called?()AThe charAt() method of the String class.BThe toUpperCase() method of the String class.CThe replace() method of the String class.DThe reverse() method of the StringBuffer class.EThe length() method of the StringBuffer class.
单选题C#中String和StringBuilder的区别,下列描述正确的是()。AString在进行运算时会产生一个新的实例,而StringBuilder则不会BStringBuilder是引用类型而String是值类型CString类型可以隐式转换为StringBuilder类型DStringBuilder在进行运算时会产生一个新的实例,而String则不会
多选题Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()AWhen using versions of Java technology earlier than 5.0.BWhen sharing a StringBuffer among multiple threads.CWhen using the java.io class StringBufferInputStream.DWhen you plan to reuse the StringBuffer to build more than one string.
单选题Given this method in a class: public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(‟‟); return buffer.toString(); } Which is true?()A This code is NOT thread-safe.B The programmer can replace StringBuffer with StringBuilder with no other changes.C This code will perform well and converting the code to use StringBuilder will not enhance the performance.D This code will perform poorly. For better performance, the code should be rewritten: return ““+ this.name + “”;
单选题关于 String、StringBuffer 和 StringBuilder 说法错误的是()AString 创建的字符串是不可变的BStringBuffer 创建的字符串是可变的,而所引用的地址一直不变CStringBuffer 是线程安全的,因此性能比 StringBuilder 好DStringBuilder 没有实现线程安全,因此性能比 StringBuffer 好
问答题String/StringBuilder的异同