Characters |
To declare a variable to be of character type:
private char letter;Use single quotes for character constants: 'H' is a char; "H" is a String:
char letter = 'H';
Demo 4. Using charAt and information about characters to fix the color mixer demo from weeks ago. See the color mixer demo. Notice how it behaves if you include a non-digit in the input.
Characters |