-->
当前位置:首页 > 题库

单选题:For code below, the result s would be?

Luz5年前 (2021-05-10)题库825
For code below, the result s would be? @[A](2)
```Java
String s = String.format("2.1 can be rounded as %i\n", Math.round(2.1));
```

A. Compile error
B. 2.1 can be rounded as 2
C. 2.1 can be rounded as 2.1
D. Run-time exception




A.Compile error
B.2.1 can be rounded as 2
C.2.1 can be rounded as 2.1
D.Run-time exception


答案:A