View Single Post
  #1 (permalink)  
Old 07-30-2007, 06:27 PM
osval osval is offline
Member
 
Join Date: Jul 2007
Posts: 26
osval is on a distinguished road
How to get the max value from a list
I need to find the max value from a lot of records. this is my code

Code:
double max = 0.0; for (int i=1; i<size; i++){ max = data[0]; if (data[i]>max) { max = data[i]; } System.out.println(max);

But it saves the last highest number on the list and it doesn't compare the values.
How can I get it to find the max value from the entire list?
Reply With Quote
Sponsored Links