What is the difference between a static and const variable?

前端 未结 17 1813
天命终不由人
天命终不由人 2020-11-29 18:39

Can someone explain the difference between a static and const variable?

17条回答
  •  广开言路
    2020-11-29 18:49

    A constant value cannot change. A static variable exists to a function, or class, rather than an instance or object.

    These two concepts are not mutually exclusive, and can be used together.

提交回复
热议问题