How do we answer questions like: What grade did you get on the test? What letter does your name start with?

The char data type can hold any character, like a letter, space, or punctuation mark.

It must be surrounded by single quotes, '.

For example:

char grade = 'A'; char firstLetter = 'p'; char punctuation = '!';



Create a variable called expectedGrade of type char.

Fill it with a single letter, representing the grade you think you would get in a graded Java course where the grades A, B, C, D and F are possible.


Print out your expectedGrade variable!

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?