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

Consider these declarations.

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

Which statement will cause an error?

A

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

B

charList.add(s);

C

charList.add((char) num);

D

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

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1kaisuki11 0m 00s 100
#2y.seong202712 1m 04s 26
#3singhris00014 1m 58s -48
APFIVE © 2020.
Email: [email protected]|Privacy Policy