I need to access the same function for all the cases so I implemented the multiple cases in the if condition. as IDE Throws an error for this, it is obvious that this is the wrong implementation. But is there something which can be an alternative to such logic.
java
void movie() {
int m;
System.out.println("Choose the movie :");
System.out.println("1.BAHUBALI\n2.SHIVAAY\n3.DANGAL\n4.AIRLIFT");
m =sc.nextInt();
switch(m){
if(case 1: || case 2: || case 3: || case 4:) {
Payment();
}
else {
System.out.println("Choosen an Invlid option");
}
}
}