| 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
< Prev
Next >

Which missing line correctly declares and initializes the char variable ‘grade’ to ‘C’?

public class CharDemo {
    public static void main(String[] args) {
        // Missing line: declare a variable 'grade' as a char with the value 'C'
        System.out.println(grade);
    }
}
A

char grade = ‘C’;

B

String grade = ‘C’;

C

char grade = C;

D

char 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
Time
Score
#1bommasam00011 0m 12s 88
#2patrickmeijer00913 0m 32s 48
#3y.seong202711 0m 53s 47
#46test6ing601 0m 00s -10
#5lsj0803092212 15m 00s -810
#6parth.taur22722 1h 46m -6,165
Items per page:
10
1 – 6 of 6
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy