package com.learningjava.conditionals;
public class SwitchExcercises {
public static boolean isWeekDay(int dayNumber) {
switch (dayNumber) {
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
case 5:
case 6:
return false;
case default:
return false;
}
}
}
我正在使用Eclipse作为我的ide.在大小写默认旁边显示错误,表示
The preview feature Pattern Matching in Switch is only available with source level 20 and above.
使用Java-se 17.谢谢你的帮助.