...
Computer-Networks
October 3, 2023
OOPS
October 3, 2023
Computer-Networks
October 3, 2023
OOPS
October 3, 2023

KVS 30-12-2018 Part B

Question 16
Which of the following are valid calls to math.max in java?

  1. Math.max(1,4)
  2. Math.max(2.3,5)
  3. Math.max(1,3,5,7)
  4. Math.max(-1.5,-2.8f)
A
A,b and d
B
B,c and d
C
A,b and c
D
C and d
Question 16 Explanation: 
→The java.lang.Math.max(int a, int b) returns the greater of two int values.
→We can find the greater of any two data types variables.
→Option C consists of four variables , So it is invalid.
Correct Answer: A
Question 16 Explanation: 
→The java.lang.Math.max(int a, int b) returns the greater of two int values.
→We can find the greater of any two data types variables.
→Option C consists of four variables , So it is invalid.

Leave a Reply

Your email address will not be published. Required fields are marked *