Welcome Guest | Sign in | Register
java.lang.class - Discussion Page For Q.2898 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > java.lang.class > Questions and Answers

Exercise:

Section 1

Q: Which of the following are valid calls to Math.max? 

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.  1,2 and 4 B. 2,3 and 4
C. 1,2 and 3 D. 3 and 4

Answer and Explanation

Answer: 1,2 and 4

Explanation:
(1), (2), and (4) are correct. The max() method is overloaded to take two arguments of type int, long, float, or double.
(3) is incorrect because the max() method only takes two arguments.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.