Updated: 01/31/2019 by Computer Hope

The abbreviation char is used as a reserved keyword in some programming languages, such as C, C++, C#, and Java. It is short for character, which is a data type that holds one character (letter, number, etc.) of data. For example, the value of a char variable could be any one-character value, such as 'A', '4', or '#'.

Also, other languages that do not have char as a data type may use the abbreviation for certain methods that are used with string values. For example, JavaScript has methods such as charAt() and charCodeAt() that return values pertaining to the calling string. The charAt() method, for instance, returns a string containing one character, which is the character at the location given as a parameter to the function. Running the following code would alert the value of the character at position 2 in the string "computer hope" (starts from 0 rather than 1):

mystring = "computer hope";

The above code would send an alert with the text m, because "c" is at the 0 position, "o" is at the 1 position, and "m" is at the 2 position.

Character, Computer abbreviations, Programming terms