下面关于 Math.random()方法生成的随机数,正确的是哪项()
A. 0.865296389806259
B. -0.2
C. 3
D. 1.2
下列选项中,哪个是程序正确的输出结果?()1 class StringDemo{2 public static void main(String[] args){3String s1 = “a”;4String s2 = “b”;5show(s1,s2);6System.out.println(s1+s2);7 }8 public static void show(String s1,String s2){9s1 = s1 +”q”;10s2 = s2 + s1;11 }12 }
A. ab
B. aqb
C. aqbaq
D. aqaqb
请说出下列代码的执行结果 :String s = "abcd";String s1 = new String(s);if (s = = s1) System.out.println("the same");if (s.equals(s1)) System.out.println("equals");
A. the same equals
B. equals
C. the same
D. 什么结果都不输出
下列代码的执行结果是什么?String s1 = "aaa";s1.concat("bbb");System.out.println(s1);
A. aaa
B. aaabbb
C. bbbaaa
D. bbb