what is the output ? Math.floor(-2.1)
a)2
b)-2
c)-3.0
d)0

Answers were Sorted based on User's Feedback



what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0..

Answer / amarnath88888

Math.floor(x) function will return the nearest integer which
is less than the passed value x.

Since -3.0 < -2.1,
-3.0 is the nearest smallest integer.

so answer is c)-3.0

Is This Answer Correct ?    28 Yes 2 No

what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0..

Answer / sasirekha

answer is -3.0

Is This Answer Correct ?    18 Yes 2 No

what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0..

Answer / blessy carolina

-3.0

Is This Answer Correct ?    5 Yes 0 No

what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0..

Answer / evelin

-2 is the nearest smallest integer to -2.1

Is This Answer Correct ?    2 Yes 15 No

Post New Answer

More Core Java Interview Questions

What is return in java?

0 Answers  


Differentiate between postfix and prefix operators in java.

0 Answers   HCL,


Can we have multiple classes in single file ?

0 Answers  


How we create object in copy constructor?

0 Answers   HCL,


Why do we use threads in java?

0 Answers  






Why should we create an object? what is a need of it? Apart from access members of a class i want what is a need of object what does it contain?? In normal class to access any member of thaht class we create object where as for static class we access its members using class name. what is a difference between them... thanks in advance.

1 Answers  


What is the function of http?

0 Answers  


Why are pointers not secure?

0 Answers  


What is a buffer in computer?

0 Answers  


I want to persist data of objects for later use. What is the best approach to do so?

0 Answers  


What is an immutable class?

0 Answers  


What is bufferedwriter?

0 Answers  


Categories