Im starting to learn java and im trying out switch statements. Long story short my question is are able to put a condition in a switch statement? Below is what im trying to do
System.out.print("Enter credits: ");
credits = in.nextInt();
switch(credits){
case (credits > 12):
//do something
break;
case (credits < 12):
//do something
break;
default:
//do something
break;
im getting errors in my compiler so im assuming you cant, but maybe im just doing it wrong, or theres just another syntax to do it? Any help is appreciated. Thanks!