Boolean Expressions
Evaluate to true or false. Relational: ==, !=, <, >, <=, >=. Logical: && (and), || (or), ! (not).
Example: (x > 0 && x < 10) is true when x is between 1 and 9.

Read the notes, then try the practice. It adapts as you go.When you're ready.
Session Length
~18 min
Adaptive Checks
16 questions
Transfer Probes
7
Control flow determines the order in which statements execute in a Java program. Boolean expressions evaluate to true or false using relational operators (==, !=, <, >, <=, >=) and logical operators (&&, ||, !). The if-else statement selects code paths based on conditions.
Iteration with for, while, and do-while loops repeats code blocks. For loops control initialization, condition, and update in one line. While loops check before each iteration. Nested loops enable matrix traversal and pattern generation.
Short-circuit evaluation in && and || skips the right operand when the result is already determined. These concepts form 32.5-40% of the AP CSA exam.
One step at a time.
Adjust the controls and watch the concepts respond in real time.
Evaluate to true or false. Relational: ==, !=, <, >, <=, >=. Logical: && (and), || (or), ! (not).
Example: (x > 0 && x < 10) is true when x is between 1 and 9.
Conditional branching. if checks condition; else provides alternative. else-if chains multiple conditions.
Example: if(score>=90) grade=A; else if(score>=80) grade=B; else grade=C;
Repeats with init, condition, update. Executes body while condition true. Counter-controlled iteration.
Example: for(int i=0; i<5; i++) { System.out.println(i); } // prints 0-4
while checks condition before each iteration. do-while executes body at least once, checks after.
Example: while(x>0){x--;} // may never run. do{x--;}while(x>0); // runs once min
&& stops if left is false. || stops if left is true. Prevents unnecessary evaluation.
Example: if(arr!=null && arr.length>0) // safe: skips length if null
!(a&&b) equals !a||!b. !(a||b) equals !a&&!b. Flip operator and negate each operand.
Example: !(x>5 && y<3) is equivalent to (x<=5 || y>=3)
Placing if/loop inside another. Inner loop completes fully for each outer iteration.
Example: for(int r=0;r<3;r++) for(int c=0;c<4;c++) // 12 total iterations
Choose a different way to engage with this topic β no grading, just richer thinking.
Explore your way β choose one:
See how the key ideas connect. Nodes color in as you practice.
Walk through a solved problem step-by-step. Try predicting each step before revealing it.
This is guided practice, not just a quiz. Hints and pacing adjust in real time.
Small steps add up.
What you get while practicing:
The best way to know if you understand something: explain it in your own words.
More ways to strengthen what you just learned.