4.
The statement System.out.printf("%3.1f", 1234.56) outputs ___________.
回答错误
单选题 (1 分) 0 分
123.5
1234.56
123.4
1234.6
1234.5
注意四舍五入
6.
What is Math.round(3.6)?
单选题 (1 分) 1 分
3.0
3
4.0
4
四舍五入,注意
-1.5得到的是-1
-1.6得到-2
1.5得到2
1.4得到1
8.
Math.floor(5.5) evaluates to _____.
回答错误单选题 (1 分) 0 分
6.0
5.0
5
6
向下取整
5.5得到5.0
-5.5得到-6.0
12.
A Java character is stored in __________.
回答错误
单选题 (1 分) 0 分
one byte
three bytes
four bytes
two bytes
20.
What is Math.rint(3.6)?
单选题 (1 分) 1 分
4.0
3
5.0
3.0
27.
Assume that the ASCII code for character c is 99. What is the printout of the following code?
System.out.println("a" + 'c');
回答错误
单选题 (1 分) 0 分
196
9799
a99
ac
41.
Which of the following method returns the sine of 90 degree?
回答错误
单选题 (1 分) 0 分
Math.sin(Math.PI)
Math.sin(Math.toRadian(90))
Math.sine(90)
Math.sin(90)
Math.sin(PI)
Java Math.toRadians() 方法用于将角度转换为弧度
50.
What is "Welcome" + 1 + 1*2?
回答错误
单选题 (1 分) 0 分
Welcome11*2
Welcome3
Welcome12
Welcome4
54.
Suppose Character x = new Character('a'), __________________ returns true.
回答错误
多选题 (3 分) 0 分
x.equals(new Character('a'))
x.compareToIgnoreCase('A')
x.equalsIgnoreCase('A')
x.equals('a')
x.equals("a")
58.
Which of the following are valid specifiers for the printf statement?
多选题 (3 分) 3 分
%6d
%10.2e
%8.2d
%10b
%4c
67.
Suppose i is an int type variable. Which of the following statements display the character whose Unicode is stored in variable i?
单选题 (1 分) 1 分
System.out.println((int)i);
System.out.println(i + " ");
System.out.println((char)i);
System.out.println(i);