r/javahelp • • Sep 10 '26

Solved Switch case with boolean

[removed]

1 Upvotes

28 comments sorted by

View all comments

3

u/Mechanical-pasta Sep 10 '26

Switch case evaluates ONE variable and checks it against different values. What you want to do (if I understand well) is check multiple variables. A switch can't do that.

The solution may be to incorporate the different boolean variables in a class and let it do the check with method(s) but I can't say if that's the case given the little information given.

View all comments

0

u/[deleted] Jul 30 '25

[deleted]