i got the error " minimum2" might have been not initlialized" , what i have to do now?
I dont get the solution....
package de.codegym.task.task02.task0217;
/*
Die kleinste aus vier Zahlen
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
int minimum2;
if(min(a,b) > c && d > c){
c = minimum2;
}else if(min(a,b) > c && d > d ){
minimum2 = d;
}
return minimum2;
}
public static int min(int a, int b) {
int minimum1;
if (a < b){
minimum1 = a;
}else{
minimum1 = b;
}
return minimum1;
}
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));
}
}