Hello,
Could anyone please tell me why it doesn't compile? (I've tried at the end with both "else if" and just "else", but that's not the problem). The compiler says "error: not a statement".
Thank you very much!
package com.codegym.task.task04.task0411;
/*
Seasons on Terra
*/
public class Solution {
public static void main(String[] args) {
checkSeason(12);
checkSeason(4);
checkSeason(7);
checkSeason(10);
}
public static void checkSeason(int month) {
if (month == 12 || month <= 2 ) {
System.out.println("winter");
{ else if (month >= 3 || month <=5) {
System.out.println("spring");
} else if (month >= 6 || month <= 8) {
System.out.println("summer");
} else {
System.out.println("autumn");
}
}
}