题目内容

给定下列程序:public class Test{public static void main(String args[]){String str=new String("World");char ch[]={'C','e','l','l','o'};change(str,ch);System.out.println(str+"and"+ch);} public static void change(String str,char ch[]){str="Changed";ch[0]='H';

A. World and Cello
B. World and Hello
Changed and Hello
D. Changed and Cello

查看答案
更多问题

对于以下声明:String s1="hello";String s2="world";String s3;下面的操作合法的是( )

A. s3=s1+s2;
B. s3=s1-s2;
C. s3=s1&s2;
D. s3=s1&&s2;

下列程序运行的结果为: ( )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. 4
B. 5
C. 6
D. 9

String s="abcdedcba";则s.subString(3,4)返回的字符串是下列选项中的哪一个()

A. cd
B. de
C. d
D. e

下列数据中有效数字不是四位的是 ( )

A. 0.2400
B. 0.0024
C. 2.004
D. 20.40

答案查题题库