Why is there no Constant feature in Java?

后端 未结 8 1853
青春惊慌失措
青春惊慌失措 2020-11-28 02:20

I was trying to identify the reason behind constants in Java I have learned that Java allows us to declare constants by using final keyword.

My question

8条回答
  •  情歌与酒
    2020-11-28 02:57

    There would be two ways to define constants - const and static final, with the exact same semantics. Furthermore static final describes the behaviour better than const

提交回复
热议问题