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.

...