Are Java enums considered primitive or reference types?

前端 未结 4 1650
臣服心动
臣服心动 2021-02-01 12:28

If I have an enum object, is it considered a primitive or a reference?

4条回答
  •  执笔经年
    2021-02-01 12:48

    This article essentially shows you how enums are implemented, and as SLaks says, they are references.

提交回复
热议问题