| preferred AP College board partner for AP classes
AP Computer Science A/Unit 7: ArrayList
Start Practice TestPractice Test
About Exam
easy Solved by 5 students
ArrayList Add Method Type Compatibility
< Prev
Next >

Consider the following declarations.

ArrayList<Character> charList = new ArrayList<Character>();
String s = "A";
int num = 65;

Which of the following statements will cause a compilation error?

A

charList.add(s.charAt(0));

B

charList.add(Character.valueOf(‘C’));

C

charList.add((char) num);

D

charList.add(s);

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
#1kaisuki11 0m 00s 100
#2bommasam00012 0m 33s 57
#3y.seong202712 1m 04s 26
#4singhris00014 1m 58s -48
Items per page:
10
1 – 4 of 4
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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