12.3.3.6 Switch statements
In a switch statement stmt with controlling expression expr:
?The definite assignment state of v at the beginning of expr is the same as
the state of v at the
beginning of stmt.
?The definite assignment state of v on the control flow transfer to a
reachable switch block statement
list is the same as the definite assignment state of v at the end of expr.
In a switch statement stmt with controlling expression expr:
?The definite assignment state of v at the beginning of expr is the same as
the state of v at the
beginning of stmt.
?The definite assignment state of v on the control flow transfer to a
reachable switch block statement
list is the same as the definite assignment state of v at the end of expr.
博客围绕Switch语句展开,阐述了在Switch语句中,控制表达式开始时变量的确定赋值状态与语句开始时相同;控制流转移到可达的Switch块语句列表时,变量的确定赋值状态与控制表达式结束时相同。
4964

被折叠的 条评论
为什么被折叠?



