When to use Enum / Int Constants

前端 未结 5 1856
小蘑菇
小蘑菇 2021-02-07 08:19

I have a question that when should we use Enum and when should we use a final constants?

I know that it has been discussed at Enums and Constants. Which to use when? tho

5条回答
  •  佛祖请我去吃肉
    2021-02-07 08:56

    Basically the Android core is C/C++ code. This works with integers. So when using enums in Java every value had to be "translated". This would cost CPU time and memory. Both are rare on embedded systems.

提交回复
热议问题