Character Literal

Summary

Creates a character value.

Syntax

`character`

Parameters

character
Any valid 16-bit Unicode character.

Description

Character literals create a character value. The character value can be any single 16-bit Unicode character value ranging from U+0000 to U+FFFF.

Character literals can be used as a shorthand for instantiating System.Character. Thus, the following statements are equivalent:

1
2
char a = `a`;
System.Character a = new System.Character(`a`);

Examples

Creating characters with character literals
1
2
3
char a = `a`;
char b = `b`;
char c = `c`;

See Also

Share

HTML | BBCode | Direct Link