>
Click HERE for in detail of the Methods of Character class.
Click HERE for the ASCII Table for different Characters
The Character Class: (Part 1)
- A character data type represents a single character.
- The character data type, char, is used to represent a single character. A character literal is enclosed in single quotation marks.
- For example: (char literals)
char letter = 'A';
Here, the first statement assigns character A to the char variable letter. The second statement assigns digit character 4 to the char variable numChar.
char numChar = '4'; - NOTE: A string literal must be enclosed in quotation marks (" "). A character literal is a single character enclosed in single quotation marks (' '). Therefore, "A" is a string, but 'A' is a character.
- Also, a string is a combination of one or more characters. We can also see Strings as "A Sequence of Characters".
- Every key on the keyboard has a specific integer value. It is known as the ASCII code. See HERE for more information.
Methods of Character class:
Click HERE for in detail of the Methods of Character class.
Click HERE for the ASCII Table for different Characters
Comments
Post a Comment