Difference between Static and final?

后端 未结 11 1249
天涯浪人
天涯浪人 2020-11-27 08:51

I\'m always confused between static and final keywords in java.

How are they different ?

11条回答
  •  时光取名叫无心
    2020-11-27 09:45

    static means there is only one copy of the variable in memory shared by all instances of the class.

    The final keyword just means the value can't be changed. Without final, any object can change the value of the variable.

提交回复
热议问题