am i using the wrong method in this code or is there a way i can edit the code without clearing the code ?
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) {
if (c < a) {
a = c;
}
if (d < a) {
a = d;
}
return a;
}
public static int min(int a, int b) {
if (b < a) {
a = b;
}
return a;
}
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));
}
}