In these cases, having some sort of general purpose defaultstatement is very important.
在这种情况下,存在某种能够通用的default语句是非常重要的。
2
You can use the defaultstatement with enums and switches, just as you would expect. Listing 7 illustrates this usage
正如您所期待的,在使用枚举和 switch 时,您可以使用 default 语句。
3
Consider the code above and realize that any enumerated value not specifically processed by a case statement is instead processed by the defaultstatement.