Why does it say that "Else without if" when they are both there? If I comment out the 'else' statement it works properly, but I need both to work properly to meet all the requirements, right? I've had issues with accidentally trying to 'fix' a bug that is actually an intended feature and want to make sure that I'm not doing that here, but regardless of that, I don't understand why it can only see the 'if' statement if there is no 'else' statement. I'd like to know what's wrong and why it doesn't work, not because I need proof of why it's wrong, but if I understand why the compiler can't read it I can more easily avoid the issue in the future.
package en.codegym.task.pro.task03.task0301;
import java.util.Scanner;
/*
Warm or cold
*/
public class Solution {
public static void main(String[] args) {
String cold = "It's cold outside";
String warm = "It's warm outside";
//write your code here
Scanner console = new Scanner(System.in);
int temp = console.nextInt();
if (temp < 0);
System.out.println(cold);
else
System.out.println(warm);
}
}