Results 1 to 2 of 2
- 07-30-2007, 05:27 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 26
- Rep Power
- 0
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
Java 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?
- 07-30-2007, 06:43 PM #2
Senior Member
- Join Date
- Jul 2007
- Posts
- 135
- Rep Power
- 0
Similar Threads
-
Members List
By Eranga in forum Suggestions & FeedbackReplies: 11Last Post: 01-17-2008, 11:41 AM -
To display as a list
By yuvi461 in forum New To JavaReplies: 2Last Post: 01-09-2008, 01:06 PM -
Linked List
By rnavarro9 in forum New To JavaReplies: 0Last Post: 11-29-2007, 04:42 AM -
list
By Zensai in forum New To JavaReplies: 3Last Post: 11-20-2007, 08:22 AM -
Link List
By one198 in forum New To JavaReplies: 0Last Post: 10-14-2007, 02:33 PM
Bookmarks