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!

Return max value of the table

807601Feb 22 2008 — edited Feb 22 2008
Hi I'm trying to get the max value of my table, my code doesn't work :(

public static void GetMaxMax(int[]tobi){
int max = 0;

for (int i = 0; i < tobi.length-1; i++){
if (tobi[i] > tobi[i+1])
max = tobi;
}
System.out.println("the max value is: "+max);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 21 2008
Added on Feb 22 2008
7 comments
104 views