Issue with using switch in Java

前端 未结 5 1792
谎友^
谎友^ 2021-01-23 16:22

I can\'t figure out why it\'s always returning the value of arg1. I\'m building a weight converter.

public double convert(double arg1,int arg2,int arg3) {
    //         


        
5条回答
  •  轮回少年
    2021-01-23 16:41

    You should be using break in switch statements,else your result may get detoriated

提交回复
热议问题