0 votes
in JAVA by

Explain use of String in the switch case in Java?

1 Answer

0 votes
by

Can we use String in the switch case?

We can use String in switch case but it is just syntactic sugar. Internally string hash code is used for the switch. See the detailed answer for more explanation and discussion.

Related questions

0 votes
asked Apr 20, 2020 in JAVA by Hodge
0 votes
asked Oct 21, 2020 in JAVA by rahuljain1
...