Java - final variables

前端 未结 7 1251
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 01:43

I know that once a final variable has a value assigned to it, it cannot be changed. However I just have a couple of questions regarding this:

  • When I have a

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 02:06

    The correct answer is that a static final var is always initialized at class init time -- either to the value you supply or to the default value (null, 0, false).

提交回复
热议问题