Java switch : variable declaration and scope

后端 未结 7 634
予麋鹿
予麋鹿 2020-12-11 03:14

How does the Java compiler handle the following switch block ? What is the scope of the \'b\' variable ?

Note that the \'b\' variable is declared only in the first b

相关标签:
7条回答
  • 2020-12-11 04:08

    The scope is, just as usual, delimited by { and }.

    0 讨论(0)
提交回复
热议问题