Auto-unboxing, switch, short circuit logical operators & exception handling are core Java basics that sometimes lead to obscure errors if not understood well & often tested in coding tests.
Q1. What is wrong with this code?
A1. compile-error at switch(i) as switch works only with “int”
…