This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Finding the maximum between 3 values II Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Finding the maximum between 3 values II" Watch "Finding the maximum between 3 values II" New topic
Author

Finding the maximum between 3 values II

Sam Bluesman
Ranch Hand

Joined: Nov 21, 2004
Posts: 191
If i am using Math.max(a, Math.max(b, c)) , but, say, b and c are the same and are both bigger than a, then which does it chose to return?

Thanks


Moosey knows best
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
Since they're primitives, not objects, there is no concept of returning one or the other. They're indistinguishable from each other, and from all other variables having the same value.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Finding the maximum between 3 values II
 
Similar Threads
Kathy's book - chapter 6 - question #7
Finding the maximum between 3 values?
pick the largest, second and third number from an array
Largest numbers
compare three double numbers