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

Is there any difference between synchronized methods and synchronized statements?

0 Answers  


What do you mean by light weight and heavy weight components?

0 Answers  


Can we override a variable in java?

0 Answers  


justify c is portable

1 Answers  


How do you create a sop?

0 Answers  






Implementations of set interface?

0 Answers  


Why convert an applet to an application?

0 Answers  


what is auto boxing

3 Answers   UHG,


When does a class need a virtual destructor?

0 Answers   Flextronics,


We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

0 Answers   Symphony,


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

0 Answers  


Explain about GridBag Layout?

1 Answers  


Categories