What this deck covers
This deck focuses on If Statements, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study If Statements in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
What is the difference between '=' and '==' in Java?
Tap card or press Space to flip
'=' is assignment, '==' is equality check. Assignment stores a value, equality comparison tests for same value.
How well did you know it?
Card 1 / 74
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on If Statements, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: '=' is assignment, '==' is equality check. Assignment stores a value, equality comparison tests for same value.
Answer: ||. Double pipe requires at least one condition to be true.
Answer: The first block executes. True conditions execute the if block, false conditions execute else.
Answer: To execute code based on a condition. Allows conditional execution of code blocks based on boolean expressions.
Answer: To execute code based on a condition. Allows conditional execution of code blocks based on boolean expressions.
Answer: if (x == 10) { System.out.println("Ten"); }. Use double equals for comparison, not single equals for assignment.
Answer: if. Reserved keyword that begins every conditional statement in Java.
Answer: false. Nine is not greater than or equal to ten.
Answer: The else block executes. AND operation with false makes entire condition false, triggering else.
Answer: false. Five is not less than three, so the condition evaluates to false.
Answer: true. Negative one is indeed less than zero.
Answer: else if. Allows chaining multiple conditions in sequence.
Answer: No. False condition skips if block, so else block executes instead.
Answer: When all conditions are false. Else serves as the default case when no if/else-if conditions match.
Answer: &&. Double ampersand requires both conditions to be true.
Answer: if (x == 10) { System.out.println("Ten"); }. Use double equals for comparison, not single equals for assignment.
Answer: else. Provides an alternative path when the if condition is false.
Answer: Remove the closing brace '}' after the statement. Single statements don't need braces, so the extra closing brace is invalid.
Answer: if (condition) { statements; }. Standard Java syntax with condition in parentheses and statements in braces.
Answer: true. Negative one is indeed less than zero.
Answer: false. Seven cannot be both less than five and greater than ten simultaneously.
Answer: false. Five is not less than three, so the condition evaluates to false.
Answer: No output. Since x equals 5, the not-equal condition is false, so nothing prints.
Answer: Remove the semicolon ';' after the condition. Semicolon after condition creates empty statement, breaking the if structure.
Answer: The else block executes. When no previous conditions are true, else provides the default action.
Answer: No. Since 3 equals 3, the not-equal condition is false, executing else.
Answer: !=. Exclamation equals tests for inequality between two values.
Answer: Add a semicolon ';' after "Yes". Missing semicolon after println statement causes compilation error.
Answer: else { statements; }. Else block syntax follows the if block with statements in braces.
Answer: ==. Double equals compares values for equality, unlike single equals for assignment.
Answer: true. Both x equals zero and x greater than negative one are true.
Answer: Yes. Since 5 > 3 is true, the if block executes and prints.
Answer: boolean. Conditions must evaluate to either true or false.
Answer: Remove the closing brace '}' after the statement. Single statements don't need braces, so the extra closing brace is invalid.
Answer: false. Nine is not greater than or equal to ten.
Answer: A. OR operation with true makes entire condition true, executing if block.
Answer: '=' is assignment, '==' is equality check. Assignment stores a value, equality comparison tests for same value.
Answer: No. Since 8 ≠ 10, the condition is false and else block executes.
Answer: if. Reserved keyword that begins every conditional statement in Java.
Answer: else. Provides an alternative path when the if condition is false.
Answer: false. Seven cannot be both less than five and greater than ten simultaneously.
Answer: No output. Since x equals 5, the not-equal condition is false, so nothing prints.
Answer: Hello. The condition true always executes the if block.
Answer: true. OR condition is true when x equals either 5 or 10.
Answer: else { statements; }. Else block syntax follows the if block with statements in braces.
Answer: When all conditions are false. Else serves as the default case when no if/else-if conditions match.
Answer: boolean. Conditions must evaluate to either true or false.
Answer: Remove the semicolon ';' after the condition. Semicolon after condition creates empty statement, breaking the if structure.
Answer: No. Since 3 equals 3, the not-equal condition is false, executing else.
Answer: The else block executes. When no previous conditions are true, else provides the default action.
Answer: else. Else provides the alternative when the if condition fails.
Answer: Add a semicolon ';' after "Yes". Missing semicolon after println statement causes compilation error.
Answer: No. Since 8 ≠ 10, the condition is false and else block executes.
Answer: if (condition) { statements; }. Standard Java syntax with condition in parentheses and statements in braces.
Answer: Compilation error. Integer variables cannot be used directly as boolean conditions in Java.
Answer: The first block executes. True conditions execute the if block, false conditions execute else.
Answer: ==. Double equals compares values for equality, unlike single equals for assignment.
Answer: true. Less than or equal includes equality, so 10 ≤ 10 is true.
Answer: No. False condition skips if block, so else block executes instead.
Answer: &&. Double ampersand requires both conditions to be true.
Answer: else if. Allows chaining multiple conditions in sequence.
Answer: ||. Double pipe requires at least one condition to be true.
Answer: else if (condition) { statements; }. Else if combines else and if to test additional conditions sequentially.
Answer: Yes. Since 5 > 3 is true, the if block executes and prints.
Answer: else. Else provides the alternative when the if condition fails.
Answer: The else block executes. AND operation with false makes entire condition false, triggering else.
Answer: Compilation error. Integer variables cannot be used directly as boolean conditions in Java.
Answer: true. Less than or equal includes equality, so 10 ≤ 10 is true.
Answer: true. OR condition is true when x equals either 5 or 10.
Answer: else if (condition) { statements; }. Else if combines else and if to test additional conditions sequentially.
Answer: A. OR operation with true makes entire condition true, executing if block.
Answer: Hello. The condition true always executes the if block.
Answer: true. Both x equals zero and x greater than negative one are true.
Answer: !=. Exclamation equals tests for inequality between two values.