String s = "abcdedcba";则s.substring(3,4)返回的字符串是以下选项中的哪个?
查看答案
阅读下面的程序:public class test { public static void main(String args[]) { int i; float f = 2.3f; double d = 2.7; i = ((int)Math.ceil(f)) * ((int)Math.round(d)); System.out.println(i); } } 程序执行后,运行结果为以下哪个选项?
A. 9
B. 5
C. 6
D. 6.1
下列选项中,可以正确创建一个字符串的是?( )
A. String s = "itcast";
B. String s = new String("itcast");
C. String s = new String(new char[] {'i','t','c','a','s','t'});
D. String s = new String(new int[]{1,2,3});
下列选项中,可以实现String初始化的是?()
A. String str = "abc";
B. String str = new String();
C. String str = new String("abc");
D. char[] chs = {'a','b','c'};
下列选项中,属于StringBuffer类特点的是?()
A. 字符串缓冲区,提高字符串的操作效率
B. StringBuffer类是线程安全的
C. StringBuffer类的toString()方法用于返回缓冲区中的字符串
D. StringBuffer是不可变的对象