1. switch(x) { default: System.out.println("Hello"); } Which two are acceptable types for x? byte long char float Short Long
Ask Your Doubts Here
Comments
By: guest on 02 Jun 2017 01.26 am
Switch statements are based on integer expressions and since both bytes and chars can implicitly be widened to an integer, these can also be used. Also shorts can be used. Short and Long are wrapper classes and reference types can not be used as variables.