Can't figure out where my code is failing. Can anyone give me a hint?
The complier is outputting:
variable ans might not have been initialized:
Solution.java, line: 20, column: 16
com/codegym/task/task02/task0216/Solution.java:20: error: variable ans might not have been initialized
return ans;
^
public static int min(int a, int b, int c) {
int ans;
if(a <= b && a <= c) {
ans = a;
} else if (b <= a && b <= c) {
ans = b;
} else if (c <= a && c <= b) {
ans = c;
}
return ans;
}