char

Java's primitive type holding one UTF-16 code unit, which covers most but not all single characters.

In more detail

Characters outside the basic range, such as many emoji, take two chars in a Java string. So a char is fine for a simple symbol but is not a complete model of a human-visible character. char literals use single quotes.

Example

char initial = 'A';

Related terms

Taught in

References

Certification courses