Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
easy Solved by 8 students

Declaring and Initializing a Char Variable

Mark
< Prev
Next >

Consider the following code segment.

public class CharDemo {
    public static void main(String[] args) {
        /* missing statement */
        System.out.println(grade);
    }
}

Which of the following can replace /* missing statement */ to correctly declare a char variable named grade and initialize it with the value 'C'?

A

char grade = C;

B

char grade = “C”;

C

char grade = ‘C’;

D

String grade = ‘C’;

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1Potter1611 0m 07s 93
#2Wilbert.Ankomah2711 0m 12s 88
#3bommasam00011 0m 12s 88
#4busemagngr11 0m 38s 62
#5patrickmeijer00913 0m 32s 48
#6y.seong202711 0m 53s 47
#76test6ing601 0m 00s -10
#8vld8kitty01 0m 45s -55
#9lsj0803092212 15m 00s -810
#10parth.taur22722 1h 46m -6,165
Items per page:
10
1 – 10 of 10

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|