When to use Enum / Int Constants

前端 未结 5 1850
小蘑菇
小蘑菇 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 09:11

    Simply put Enums use more resources then public static final fields so don't use ENUM in mobile programing where every byte counts.

    http://developer.android.com/training/articles/perf-tips.html#UseFinal

提交回复
热议问题