Simplify <code>if (a == true) return true; else return false;</code>
- A
if (a) return true;
- Bcheck_circle
return a;
- C
return a == true;
- D
return !a;
Explanation
Just return the boolean directly.
AP Computer Science A· difficulty 4/5
Simplify <code>if (a == true) return true; else return false;</code>
if (a) return true;
return a;
return a == true;
return !a;
Explanation
Just return the boolean directly.
Want 10 more like this — adaptive to your weak spots?