Can we use string value in switch case?

It is recommended to use String values in a switch statement if the data you are dealing with is also Strings . 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.

Sizin İçin Seçtik  YouTube kısa videolardan para kazanılır mı?

Leave a Reply

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