Const (computer programming): Difference between revisions

Content deleted Content added
Alai (talk | contribs)
m final in Java: dbl the
m updated c++ link
Line 1:
In [[computer science]], '''const-correctness''' is the form of program correctness that deals with the proper declaration of objects as [[mutable object|mutable]] or [[immutable object|immutable]]. The term is mostly used in a [[C programming language|C]] or [[C Plusplus Plusplus|C++]] context, and takes its name from the <code>const</code> keyword in those languages.
 
The idea of const-ness does not imply that the variable as it is stored in the [[computer]]'s [[computer storage|memory]] is unwriteable. Rather, <code>const</code>-ness is a [[compile-time]] construct that indicates what a programmer ''may'' do, not necessarily what he or she ''can'' do.