s = new String("xyz"),以下()语句将改变s的值。
A. s.append("a")
B. s.concat(s)
C. s.subString(1)
D. 以上语句都不对
查看答案
下面程序段的输出结果是()。StringBuffer buf1=new StringBuffer(20);System.out.println(buf1.length()+" , "+buf1.capacity());
A. 0,20
B. 0,null
C. 20,20
D. 0,0
能够正确计算30度余弦值的是()。
A. double d=Math.cos(30)
B. double d=Math.cosine(30)
C. double d=Math.cos(Math.toRadians(30))
D. double d=Math.cos(Math.toDegrees(30))
要产生[20,999]之间的随机整数可以使用()表达式。
A. (int)(20+Math.random()*97)
B. (int)Math.random()*999
C. 20+(int)(Math.random()*980)
D. 20+(int)Math.random()*980
随机生成一个整数,采用Random类的()方法。
A. nextInteger( )
B. nextInt( )
C. getRandomInt( )
D. nextFloat( )