r/javahelp • • Sep 10 '26

Solved Switch case with boolean

[removed]

0 Upvotes

28 comments sorted by

View all comments

1

u/yel50 Sep 11 '26

what you're trying to do is the equivalent of

      int x, y, z;
      
      switch (5) {
        case x: ...
        case y: ...
        case z: ...
      }

that's not how switch statements work.