Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Is there a way to have non-constant case labels (i.e. ranges or arbitrary expressions)?
Is there a way to have non-constant case labels (i.e. ranges or arbitrary expressions)?
✍: Guest
No. The switch statement was originally designed to be quite simple for the compiler to translate, therefore case labels are limited to single, constant, integral expressions. You can attach several case labels to the same statement, which will let you cover a small range if you don't mind listing all cases explicitly.
If you want to select on arbitrary ranges or non-constant expressions, you'll have to use an if/else chain.
2015-02-02, 1318👍, 0💬
Popular Posts:
Where are all .NET Collection classes located ? System.Collection namespace has all the collection c...
What Is the Data Pump Import Utility? - Oracle DBA FAQ - Loading and Exporting Data Oracle Data Pump...
What is the main difference between a Vector and an ArrayList? Java Vector class is internally synch...
1. What is normalization. 2. Difference between procedure and functions. 3. Oracle 9i Vs 10g. 4. how...
How you will enable front-end validation based on the xml in validation.xml? The <html:javascr...