Regarding Java switch statements - using return and omitting breaks in each case

前端 未结 10 2213
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 12:29

Given this method, does this represent some egregious stylistic or semantic faux pas:

private double translateSlider(int sliderVal) {
    switch (sliderVal) {
           


        
10条回答
  •  青春惊慌失措
    2021-02-01 13:09

    Yes this is good. Tutorials are not always consize and neat. Not only that, creating local variables is waste of space and inefficient

提交回复
热议问题