Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Largest and smallest value of an array

843785Jul 29 2008 — edited Jul 30 2008
I'm trying to figure out how to calculate the largest and smallest value within an array.
Not just any array; an array with values and length deteremined by user.
What's the best way for determining these values?

Input .. User determines array length.
Input .. User determines the value of each index.
Output .. largest and smallest values inside that array no matter what length or values the user determines.

Please help;
Provide me with a detailed solution;
and if possible some example code of how this might work.
Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2008
Added on Jul 29 2008
28 comments
1,489 views