How many case labels can be in a single switch in Java?

There can be one or N number of case values for a switch expression. The case value must be of switch expression type only. The case value must be literal or constant. It doesn’t allow variables.

Sizin İçin Seçtik  How do you match a String in a switch case?

Leave a Reply

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