+ 1
Can we make code so switch can check two values in cases? Example in code. They are higlighted in comments (Sorry for my eng)
6 Answers
+ 12
Lily... You will want to move the switch statement into another method and call that method for each value separately.
See my code for how this would look...
https://code.sololearn.com/c1KGhQ9Tf0mk/?ref=app
+ 2
In your example, which 2 values do you want it to check?
+ 1
I meant execute 2 cases but with different messages and values