Computer Applications
The output of Math.max(-7, Math.min(-5, -4)) is:
- -5
- -4
- -7
- error
Java Math Lib Methods
5 Likes
Answer
-5
Reason — The method Math.min(-5, -4) returns the smaller of the two values, which is -5. Then, Math.max(-7, -5) returns the greater of the two values, which is -5. Hence, the final output of Math.max(-7, Math.min(-5, -4)) is -5.
Answered By
2 Likes
Related Questions
Which of the following is user-defined data type?

- only 1
- 1 and 3
- only 2
- only 4
Select the infinite loop:
- for(int i = 1; i <= 10; i++)
- for(int i = 2; i != 0; i -= 3)
- for(int i = 5; i <= 5; i++)
- for(int i = 1; i >= 1; i--)
Which of the following is true for the given object creation statement?
Game cricket = new Game();- Game is an object of cricket class
- New keyword creates object Game
- Game is a class and cricket is an object
- Game and cricket are objects
Post Office is an example for …………… access specifier.
- public
- local
- protected
- private