Definition

const

Contributor(s): Matthew Haughn

Const (constant) in programming is a keyword that defines a variable or pointer as unchangeable.

A const may be applied in an object declaration to indicate that the object, unlike a standard variable, does not change. Such fixed values for objects are often termed literals. In some languages (the C family, for example) const is part of the type while in many others it is part of the object.

Types of constants include: integer literals, floating point literals, character constants and string literals. While constants are often unwritable as predefined data in C, const generally does not make the value as stored in RAM unwritable. As such, const defines more how a programmer should code rather than how they can code.

In Java, const is a reserved keyword but not used.

This was last updated in July 2016

Continue Reading About const

Dig Deeper on Mobile development and deployment

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

File Extensions and File Formats

SearchCloudApplications

SearchSoftwareQuality

SearchFinancialApplications

SearchSAP

SearchManufacturingERP

DevOpsAgenda

Close