Почему компилято не видит переменную ab?) Подскажите, где ошибка))
package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
int abcd;
if ( ab < cd)
abcd = ab;
else
abcd = cd;
return abcd;
int cd;
{ if (c < d)
cd = c;
else
cd = d;
return cd;
}
//напишите тут ваш код
}
public static int min(int a, int b) {
int ab;
if (a < b)
ab = a;
else
ab = b;
return ab;
//напишите тут ваш код
}
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));
}
}