Methods getMinimum and getMaximum
Methods getMinimum
, getMaximum
, outputBarChart
and outputGrades
each loop through array grades
by using nested for
statements—for example, the nested enhanced for
statement from the declaration of method getMinimum
(lines 58–67). The outer enhanced for
statement iterates through the two-dimensional array grades
, assigning successive rows to parameter studentGrades
on successive iterations. The square brackets following the parameter name indicate that studentGrades
refers to a one-dimensional int
array—namely, a row in array grades
containing one student’s grades. To find the lowest overall grade, the inner for
statement compares the elements of the current one-dimensional array studentGrades
to variable lowGrade ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.