KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have multiple cases in a switch that do the same thing, like so: (this is written in Java) case 1: aMethod(); break; case 2: aMethod(); break; case 3: aMethod(); break; case 4: anotherMethod(); break; Is there any way I can combine cases 1, 2 and 3 into one case, since they all call the same method?
Tags (comma-separated)
Save Edits
Cancel