KnowledgeBoat Logo
|

Computer Applications

Give the output of Math.abs(x); when x = -9.99.

  1. -9.99
  2. 9.99
  3. 0.99
  4. None of these

Java Math Lib Methods

5 Likes

Answer

9.99

Reason — Math.abs() returns the absolute value of its argument. Its return type is same as the type of its argument. Thus, Math.abs(-9.99) returns 9.99.

Answered By

2 Likes


Related Questions