Java switch statement: Constant expression required, but it IS constant

前端 未结 13 1673
予麋鹿
予麋鹿 2020-11-22 10:42

So, I am working on this class that has a few static constants:

public abstract class Foo {
    ...
    public static final int BAR;
    public static final          


        
13条回答
  •  滥情空心
    2020-11-22 11:20

    I got this error on Android, and my solution was just to use:

    public static final int TAKE_PICTURE = 1;
    

    instead of

    public static int TAKE_PICTURE = 1;
    

提交回复
热议问题