Help the world stop coronavirus! Stay home!

Prev Next

Java / Strings

Can we have case null in string switch case?

No. case null is not allowed per design. Use if condition before switch to handle null.

switch statement will throw NullPointerException when it evaluate null.

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Using String

Comments & Discussions