Q:

Write a method that returns the largest integer in the list

belongs to collection: java exercises (easy level )

0

Write a method that returns the largest integer in the list.
You can assume that the list has at least one element.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

public Integer maximum(Integer[] list) {
int maximum = list[0];
for (int i : list) {
    if (i > maximum) {
        maximum = i;
    }
}
return maximum;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Average Value (Java 8 Lambdas and Streams)... >>
<< using Linear Search ,Write a method that returns t...