case expressions must be constant expressions

java中使用switch case报错 case expressions must be constant expressions




解决问题



case后面必须跟常量,必须要常量,将上面两个变量声明为final即可。

private final int CLICK_QUERY = 1;
private final int CLICK_RESET = 2;


你可能感兴趣的:(case expressions must be constant expressions)