What Will Print? Just Need Verification
i Code:
nt temperature = 78;
int month = 6;
String name = "Barnard, KS."
if (temperature >= 70 && month >=6)
System.out.println ("Wear bikini\n");
else if (name == "Barnard, KS.")
System.out.println ("Nice day to ride my horse\n");
What is the output of the program when temperature = 70, month = 5, and name = "Barnard, KS."?
I say the output is Nice day to ride my horse, because the 1st "if" statement is FALSE and falls through to the second "if" statement. Am I right?
Thanks In Advance
What Will Print? Just Need Verification
Thanks for the quick response. Isn't it true the 1st statement will be FALSE and not execute, and go to the second "else"?
Why do you say "You are right here but not for the reasons you're thinking of, ...".
Thanks JosAH
~~Carol
What Will Print? Just Need Verification