Why, when I have cases for every enum constant in a switch statement, must I still provide a default?
Imagine if MyEnum
was a separate class. Then it would be possible to recompile the MyEnum
class, and add new values, without recompiling EnumSwitchTest
(so not getting any errors).
Then it would be possible for another class to call test
with the new value.