Why can't I use switch statement on a String?

前端 未结 16 2031
面向向阳花
面向向阳花 2020-11-21 07:57

Is this functionality going to be put into a later Java version?

Can someone explain why I can\'t do this, as in, the technical way Java\'s switch state

16条回答
  •  执笔经年
    2020-11-21 08:08

    When you use intellij also look at:

    File -> Project Structure -> Project

    File -> Project Structure -> Modules

    When you have multiple modules make sure you set the correct language level in the module tab.

提交回复
热议问题