I need to find the max value from a lot of records. this is my 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?