This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Applets and the fly likes To get Maximum and minimum value from an array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "To get Maximum and minimum value from an array" Watch "To get Maximum and minimum value from an array" New topic
Author

To get Maximum and minimum value from an array

Aayush Patel
Greenhorn

Joined: Apr 26, 2001
Posts: 21
Can anybody help me for finding maximum value and minimum value from an array of double values..i mean suppose there is an array of double values and now i want to find max and min value then is there any readymade method in double class or we have to define with our own...
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Well, there is a method in the Math class that returns the max of two double values... so to get the max of an array of doubles, you would have to do something like this...



HTH,
-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
 
subject: To get Maximum and minimum value from an array