Что это значит - Метод 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 x = 0;
if (a <= b && a <= c && a <= d)
x = a;
if (b <= a && b <= c && b <= d)
x = b;
if (c <= a && c <= b && c <= d)
x = c;
if (d <= a && d <= b && d <= c)
x = d;
return x;
}
public static int min(int a, int b) {
int x = 0;
if (a < b)
x = a;
else
x = b;
return x;
}
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));
}
}