网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
String、StringBuffer都是( )类,都不能被继承。
A
static
B
abstract
C
final
D
private
参考答案
参考解析
解析:
在Java中,字符串是作为对象出现的,由java.lang.String和java.lang.StringBuffer定义,分别用来处理长度不变可变字符串,这两类都被定义为final,final最终类指明该类不能有子类。
在Java中,字符串是作为对象出现的,由java.lang.String和java.lang.StringBuffer定义,分别用来处理长度不变可变字符串,这两类都被定义为final,final最终类指明该类不能有子类。
更多 “单选题String、StringBuffer都是( )类,都不能被继承。A staticB abstractC finalD private” 相关考题
考题
String、StingBuffer都是( )类,都不能被继承。A.staticB.abstractC.finalSX
String、StingBuffer都是( )类,都不能被继承。A.staticB.abstractC.finalD.private
考题
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类说法正确的有()。A、String类是不可变类,一个String对象所包含的字符串内容永远不会被改变B、如果对字符串中的内容经常进行操作,特别是内容要修改时,应使用StringBufferC、StringBuffer类是可变类,一个StringBuffer对象所包含的字符串内容可以被添加或修改D、字符串缓冲区支持可变的字符串
考题
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类提供了许多用来操作字符串的方法:连接,提取,查询等
考题
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类说法正确的有()。AString类是不可变类,一个String对象所包含的字符串内容永远不会被改变B如果对字符串中的内容经常进行操作,特别是内容要修改时,应使用StringBufferCStringBuffer类是可变类,一个StringBuffer对象所包含的字符串内容可以被添加或修改D字符串缓冲区支持可变的字符串
考题
多选题关于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?()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.
考题
填空题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.printIn (textString + textBuffer); } ) What is the output?()
考题
判断题String对象和StringBuffer对象都是字符串变量,创建后都可以修改A
对B
错
热门标签
最新试卷