I have made a program to tell what season it is based on the month. However, no matter what i input, it says that it is Fall. Here is the code:
import java.util.Scanner;
public class SeasonChecker {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.println("What month is it??");
String month = input.nextLine();
System.out.println(month);
if (month == "december"||month == "January"||month=="February"){
System.out.println("Then it is Winter?");
}
else if (month=="March"||month=="May"||month=="April"){
System.out.println("Then it is Spring!!!");
}
else if (month=="June"||month=="July"||month=="August"){
System.out.println("Then it is Summer!");
}
else {
System.out.println("Then it is Autumn!");
}
input.close();
}
}