switch(title)
{
case "Return":
returnBooks();
break;
}
strings in switch are not supported in -source 1.6, use -source 7 or higher to enable strings in switch
So, I have already installed JDK7, Why compiler show this message and giving an error while on compiling?
I am using NetBeans
I hate to say it, but: read the darn error message. It tells you exactly what the problem is.
You are compiling in Java 6 mode, not compiling in Java 7 mode. If you're using javac that comes with JDK 7, as the error message says, use the -source 7 flag:
> javac -source 7 {stuff here}
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