... variable maximumValue and initializes it with the value of parameter x. Of course, it’s possible that parameter y or z contains the actual largest value, so we must compare each of these with maximumValue. Lines 29–31 determine whether y is greater than maximumValue. If so, line 30 assigns y to maximumValue. Lines 34–36 determine whether z is greater than maximumValue. If so, line 35 assigns z to maximumValue. At this point the largest value resides in maximumValue, so line 38 returns that value to line 18. When program control returns to where maximum was called, maximum’s parameters x, y and z no longer exist in memory.

Get Java How to Program, Early Objects, 11th 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.