Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 464 Bytes

File metadata and controls

17 lines (13 loc) · 464 Bytes

Character Literals

In order to write a character in a program, you write that one character surrounded by single quotes.

'a'

This is called a "character literal." It has the same relationship to char that an integer literal like 123 has to int.

// Same as this "integer literal" is used to write a number
int sesameStreet = 123;
// A "character literal" is used to write text
char thisEpisodeIsBroughtToYouBy = 'c';