Sobes.tech
Intern — Middle+

Determining the largest number in an array obtained through varargs

livecode

Task condition

It is necessary to implement a function that returns the maximum value among the given numbers, using a variable-length parameter (varargs). The solution allows only basic features of the Java language — you cannot use Stream API, sorting, or third-party libraries.

private static int getMax(int... values) {
    // return the maximum number from the array values
}