Reputation: 109
I know that 'switch' on strings was not workable before java 7 and was implemented only in java 7 and later. But I am using java 8 and I still get the error message "cannot switch on strings". Can anyone explain why and how do I get around it?
Upvotes: 0
Views: 667
Reputation: 4377
Even if you are using JDK 8
it's possible that you are not using the java 8 compiler compliance level .
If you are on eclipse, you can set the compiler level like this:
Upvotes: 1