One question to consider is the difference between code that is
Unreachable and code that
should not be reachable.
Consider a method that converts and integer to a
string value and is meant to only convert the values 1 and 2.
It is private, so whoever is writing the class has complete control over how it is called. Since the method only expects to be called with a value of 1 or 2 the default branch of the switch should not be reachable. However, as far as the compiler is concerned, the default statement is reachable, hence the method will compile. (ok, for those who are pedantic, it would need to be contained in a class that compiles)
We can put an assert into the default branch to catch the situation where someone makes a call to the method with a value we were not expecting. e.g.
Regards
Dave