Type the three-step mental checklist for output questions
Type the three-step mental checklist for output questions
Answer
// 1. Does it compile? // 2. Does it throw at runtime? // 3. What is the output?
Applying these three steps in order prevents the common mistake of tracing output for code that never compiles. If step 1 fails, stop — the answer is "does not compile".