+ 2
const variables are constant variables which means you can only assign them a value once. Static is something completely different. It was introduced with object-orientated programming. Because there are two different kind of methods qnd variables in a class: static and non-static. In the following I will only mention variable, cause the concept is similar on methods. Non-static variables belong to an object which is an instance of a class. On the otherside static variables belong to the class itself and you can call them by <classname>.<varname> But this does not affect whether an variable is constant or not. You can declare your variables as normal. Its only about how to access them.
25th Dec 2016, 5:20 PM
Andreas K
Andreas K - avatar