П(А)М(А)ГИТЕ... ОБЬЯСНИТЕ!!!
package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
int m4 = min(a,b);
if (a <= c)
m4 = m4;
else
m4 = c;
if (a <= d)
m4 = m4;
else
m4 = d;
return m4;
}
public static int min(int a, int b) {
int m2;
if (a <= b)
m2 = a;
else
m2 = b;
return m2;
}
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));
}
}