dangjunhui

程序输出结果是多少?

public class getValue {
    public static void main(String[] args) {
        System.out.println(getValue(2));

    }
    
    public static int getValue(int i){
        int result = 0;
        switch(i){
        case 1:
            result = result + i;
        case 2:
            result = result + i*2;
        case 3:
            result = result + i*3;
        }
        return result;
    }

}

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-08
  • 2021-06-10
  • 2021-07-03
  • 2021-09-10
  • 2022-01-01
  • 2021-11-22
  • 2022-12-23
相关资源
相似解决方案