epifanio67
asked on
Java: in a loop, is there a way to get the lowest and highest number? the loop is of type Integer
Hello Experts,
In a loop, is there a way to get the lowest and highest number in a loop?
for (int y = 0; y < 10; y++) {
//how do I print/get/assign the lowest number on this loop?
//how do I print/get/assign the highest number on this loop?
}
notes:
y is an arrayList<Integer>
the size of y will vary, it may begin at 50 to 500,000
I want to get the lowest number to assign it to a variable and
I want to get the highest number to assign it to a variable....
In advance, thanks for your help...
Regards,
In a loop, is there a way to get the lowest and highest number in a loop?
for (int y = 0; y < 10; y++) {
//how do I print/get/assign the lowest number on this loop?
//how do I print/get/assign the highest number on this loop?
}
notes:
y is an arrayList<Integer>
the size of y will vary, it may begin at 50 to 500,000
I want to get the lowest number to assign it to a variable and
I want to get the highest number to assign it to a variable....
In advance, thanks for your help...
Regards,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I appreciate your help...
Regards,