10.10 |
Given the following program, which lines will print 11 exactly? class MyClass { public static void main(String[] args) { double v = 10.5; System.out.println(Math.ceil(v)); // (1) System.out.println(Math.round(v)); // (2) System.out.println(Math.floor(v)); // (3) System.out.println((int) Math.ceil(v)); // (4) System.out.println((int) Math.floor(v)); // (5) } } Select the two correct answers.
|
10.11 |
Which method is not defined in the Math class? Select the one correct answer.
|
10.12 |
What is the return type of the method round(float) from the Math class? Select the one correct answer.
|
10.13 |
What is the return type of the method ceil(double) from the Math class? Select the one correct answer.
|
10.14 |
What will the following program print when run? public class Round { public static void main(String[] args) { System.out.println(Math.round(-0.5) + " " + Math.round(0.5)); } }; Select the one correct answer.
|
10.15 |
Which statements are true about the expression ((int)(Math.random()*4))? Select the three correct answers.
|