What are the restrictions placed on the values of each case of a switch statement?

What are the restrictions placed on the values of each case of a switch statement?

The restrictions placed on the values of each case of a switch statement are :

    * The values of each case of a switch statement must be a compile time constant.
    * Only use the values that can be promoted to an int value, i.e. use byte, short, char, int only.



By:Jalees
Date:2016-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher