OOPS
August 29, 2024
OOPS
August 29, 2024
OOPS
August 29, 2024
OOPS
August 29, 2024

OOPS

Question 96
Find the output of the following Java code line
System.out.println(math.floor(-7.4))
A
-7
B
-8
C
-7.4
D
-7.0
Question 96 Explanation: 
The method floor gives the largest integer that is less than or equal to the argument.
But here the argument is negative value.
Floor of -7.4 will return the lower limit, i.e. -8.
Correct Answer: B
Question 96 Explanation: 
The method floor gives the largest integer that is less than or equal to the argument.
But here the argument is negative value.
Floor of -7.4 will return the lower limit, i.e. -8.

Leave a Reply

Your email address will not be published. Required fields are marked *