| preferred AP College board partner for AP classes
AP Computer Science A/Unit 7: ArrayList
Start Practice Test
Share
medium Solved by 4 students
ArrayList String Concatenation
< Prev
Next >

What will be printed when the above program is executed?

import java.util.ArrayList;
public class Test {
    public static void main(String[] args) {
       ArrayList list = new ArrayList();
       list.add(100);
       list.add("20");
       System.out.println(list.get(1) + 50);
    }
}
A

10050

B

Compilation Error

C

150

D

2050

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
#2geethasailaja13 1m 17s 3
#3upadhgau00001 0m 00s -10
#4psak1201 1m 03s -73
#5y.seong202713 5m 29s -249
#6singhris00012 14m 18s -768
APFIVE © 2020.
Email: [email protected]|Privacy Policy