WHAT WRONG GUYS :)
package com.codegym.task.task02.task0217;
/*
Minimum of four numbers
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
int m2;
if (a < b && a < c && a < d)
m2 = a;
else if (b < a && b < c && b < d)
m2 = b;
else if (c < a && c < b && c < d)
m2 = c;
else
m2 = d;
return m2;
}
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(-20, -10, -30, -40));
System.out.println(min(-20, -10, -30, 40));
System.out.println(min(-40, -10, -30, 40));
}
}