AP Computer Science A Question of the Day
Test your knowledge with a hand-picked multiple-choice question.
Consider the code below:
int i = 45, j = -12;
String s = "This is great!";
String s2 = "Where are you?";
if(s2.charAt(4) == ' ' && (i < 4 || j > -43) && !s2.equals("WOW!!!")) {
System.out.println("Happy days are here again!");
} else if (s2.charAt(5) == 's') {
System.out.println("Well, we are here at least.");
} else if (j + 12 != 0) {
System.out.println("The stock market is up today!");
} else if(i - 20 < 100) {
System.out.println("Where will we be having lunch tomorrow?");
} else {
System.out.println("But here you go!");
}
What is the output for the code above?
Select an answer and click Check.