0
Switch case executing both of the cases insteAd of 1
The whole description is in the program And run it in eclipse not the default SoloLearn one It doesn't work here I guess. Any help will be appreciated I can't seem to figure out why it's executing both of the cases When 1 is the input https://code.sololearn.com/cZsEo22KQVSl/?ref=app
2 Réponses
+ 1
The reason is explained here: https://www.sololearn.com/learn/Java/2145/
+ 2
I totally forgot that we had to add break inside a case to break the loop. Been weeks without coding ty :)