Добрый вечер. Никак не могу понять, что значит условие Метод min(a, b, c, d) должен использовать метод min(a, b). Как Это реализовать?
package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
int m;
if (a < c && a < d && a < b) {
return m = a;
}
else if (c < a && c < d && c < b) {
return m = c;
}
else if (b < a && b < c && b < d) {
return m = b;
}
else
return m = d;
}
public static int min(int a, int b) {
int u;
if (a < b) {
return a;
}
else {
return b;
}
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-40, -10, -30, 40));
System.out.println(min(-20, -40, -30, 40));
System.out.println(min(-20, -10, -40, 40));
System.out.println(min(-20, -10, -30, -40));
}
}