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