No, you can’t .
Read moreCan switch-case be used for all data types?
A switch works with the byte , short , char , and int primitive data types . It also works with enumerated types (discussed in Enum Types), the String class, and a few special classes that wrap certain primitive types: Character , Byte , Short , and Integer (discussed in Numbers and Strings).
Read moreDoes switch Use equal?
The switch statement compares the String object in its expression with the expressions associated with each case label as if it were using the String. equals method ; consequently, the comparison of String objects in switch statements is case sensitive.
Read moreWhich data type Cannot be used in switch Java?
The switch statement doesn’t accept arguments of type long, float, double,boolean or any object besides String .
Read moreCan we use contains in Java?
The contains() method in Java is used to search the substring in a given String . Returns: If the substring is found in the specified String, then it returns a true value; otherwise, it returns a false value.
Read moreHow do you call a switch case in Java?
SwitchVowelExample.java
Read moreHow do you use a while loop in a switch case?
Simple C Program of While Loop and Switch Case
Read more