Skip to content
Advertisement

How to remove duplicate cases in switch in java

I have sonarQube running but it says that there are duplicates within these lines of code. How do resolve this in a switch statement? I am just learning how unit testing in java works so any help would be great!

JavaScript

Advertisement

Answer

I think below solution should work for you:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement