I am using Neatbeans 7.0 for Java programming. I have written a Switch case for selection of the program.
switch(menu)
{
case 1:
{
//stmt
}
default:
{
//stmt
return;
}
}
I am getting compile time error at switch(menu)
The Error is "strings in switch are not supported in -source 1.6
(use -source 7 or higher to enable strings in switch)
(Alt-Enter shows hints)" Can any one please help me on this.
String cases in switch statements are supported in Java SE 7, but not in previous versions of Java. You need to compile with Java 7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With