I dont know why but the Syntax tells me all the time, that there is something wrong with "else". I´m trying since 1 hour to fix it and cant see a solution. Please help me!package de.codegym.task.task02.task0216;
/*
Die kleinste aus drei Zahlen
*/
public class Solution {
public static int min(int a, int b, int c) {
int min;
if (a <= b && a <= c);{
min = a;
}
else if (b <= a && b <= c);{
min = b;
}
else{
min = c;
}
return
min;
}
public static void main(String[] args) throws Exception {
System.out.println(min(1, 2, 3));
System.out.println(min(-1, -2, -3));
System.out.println(min(3, 5, 3));
System.out.println(min(5, 5, 10));
}
}
hier ;{ min = a; } else if (b <= a && b <= c)hier ;{ min = b; } else{ min = c; } return min; }