point of having an instance variable as final?

前端 未结 6 426
醉梦人生
醉梦人生 2021-02-01 23:25

what is the point of having an instance variable as final?

isn´t it better to have that variable set as a static final variable then?

cause if it can\'t be chang

6条回答
  •  执念已碎
    2021-02-01 23:55

    You can assign it a value that is specific to the object instance, which you can't do with a static class variable.

提交回复
热议问题