题目内容

阅读下面的程序: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是不可变的对象

下列关于StringBuffer类的描述中,正确的是( )

A. append()方法可以接受任意类型的数据
B. insert()方法可以接受任意类型的数据
C. append()方法返回的是一个新的StringBuffer对象
D. insert()方法返回的是一个新的StringBuffer对象

答案查题题库