What is String in Swtich feature in JDK7 example
Tutorials Shared by the Internet Community
What is String in Swtich feature in JDK7 example
Have you ever feel that String should be used in switch cases as like int and char? JDK 7 has made an important enhancement in there support of StringStatistics
Total Hits - 32747
Total Votes - 96 votes
Vote Up - 41 votes
Vote Down - 55 votes
Domain - javarevisited.blogspot.com
Category - JAVA/Core JAVA
Submitted By - Javin Paul
Submitted on - 2011-09-01 13:49:37
Description
Have you ever feel that String should be used in switch cases as like int and char? JDK 7 has made an important enhancement in there support of String, now you can use String in switch and case statement, No doubt String is most widely used type in Java and in my opinion they should have made this enhancement long back when they provided support for enum in java and allowed enum to be used in switch statement. In this java tutorial we will see how we can use String inside switch and case statement in JDK 7. More detail...