Java enhanced for/in
Hi all, How does the for/in works?!
I have the following small example i'm not understanding the structure:
// find minimum grade
publicint getMinimum()
{
// assume first element of grades array is smallest
int lowGrade = grades[ 0 ][ 0 ];
// loop through rows of grades array
for (int studentGrades[] : grades )
{
// loop through columns of current row
for (int grade : studentGrades )
{
// if grade less than lowGrade, assign it to lowGrade
if ( grade < lowGrade )
lowGrade = grade;
}// end inner for
}// end outer for
return lowGrade;// return lowest grade
}// end method getMinimum
My question is what do we use in it?
zeid

