Question: The method findMax is intended to return the largest element in the array of positive numbers called numbers. The method may not work as intended.
The method findMax is intended to return the largest element in the array of positive numbers called numbers. The method may not work as intended.
public int findMaxint numbers
int max ;
for int row ; row numbers.length; row
for int col ; col numberslength; col
if numbersrowcol max Line
max numbersrowcol;
return max;
Which of the following changes, if any, can be made to Line so that the method will work as intended?
Responses
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
Change numbersrowcol max to numbersrowcol max.
No change is necessary; the method works correctly as is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
