+ 2
My complier seems to find error in this code, what might be the problem?
//This is a switch expression &! statement. String dayType = switch(day) { case 1, 2, 3, 4, 5 -> "working day"; case 6,7 ->"weekend"; default->"No match"; };
5 Answers
//This is a switch expression &! statement. String dayType = switch(day) { case 1, 2, 3, 4, 5 -> "working day"; case 6,7 ->"weekend"; default->"No match"; };