java: is using a final static int = 1 better than just a normal 1?

后端 未结 7 1907
轻奢々
轻奢々 2020-12-11 06:47

I just saw a class (an big API module), where there is alot of stuff like

readParamString(Object params, int index)

and they have in that c

7条回答
  •  鱼传尺愫
    2020-12-11 06:59

    yes somehow better than using a normal int

    But If you are using Java 5 or later enum is better than final static variables.

提交回复
热议问题