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

How will you serialize a singleton class without violating singleton pattern?

0 Answers  


What are the types of classes in java?

4 Answers   HCL,


what is meant by string pooling?

12 Answers   Oracle, Polaris, Tribal Fusion, Wipro,


Can a main method be declared final?

0 Answers  


What advantage do java's layout managers provide over traditional windowing systems?

0 Answers  






Is string a data type in java?

0 Answers  


how its run?

0 Answers  


Is ++ operator is thread safe in java?

0 Answers  


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

0 Answers  


Why multiple inheritance is not supported by java?

0 Answers  


What is vector capacity in java?

0 Answers  


How do you sort arraylist in descending order?

0 Answers  


Categories