DO case statements work with strings?

Strings in switch The expression in the switch cases must not be null else, a NullPointerException is thrown (Run-time). Comparison of Strings in switch statement is case sensitive . i.e. the String you have passed and the String of the case should be equal and, should be in same case (upper or, lower).5 Tem 2019

Sizin İçin Seçtik  Does Java case work with strings?

Leave a Reply

Your email address will not be published. Required fields are marked *