Quiz_________________?
Example of short-circuit with &&? -
Answer✅
false && (x/0>1) — second part not evaluated.
Quiz_________________?
Example of short-circuit with ||? -
Answer✅
true || (x/0>1) — second part not evaluated.
Quiz_________________?
How can a switch be replaced? -
Answer✅
Using chained if-else-if statements.
Quiz_________________?
How do you compare strings in Java? -
Answer✅
Using equals() or equalsIgnoreCase(), not ==.
Quiz_________________?
1
, Is default case required in switch? -
Answer✅
No, but it's recommended.
Quiz_________________?
What are logical operators? -
Answer✅
&&, ||, !
Quiz_________________?
What are relational operators? -
Answer✅
==, !=, <, <=, >, >=
Quiz_________________?
What does an if statement do? -
Answer✅
Executes the block if the condition evaluates to true; otherwise it skips it.
Quiz_________________?
What does an if-else statement do? -
Answer✅
Executes one block if the condition is true, another if false.
Quiz_________________?
What does equals() do? -
Answer✅
Compares string contents case-sensitively.
2