Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Subtopic: Using Text Files Clear filter

Questions 11–20 of 181
  1. 11
  2. 12
  3. 13
  4. 14
  5. 15
  6. 16
  7. 17
  8. 18
  9. 19
  10. 20

Question 11

Multiple choice Using Text Files
What is printed? String s = "alpha-beta-gamma"; String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 12

Multiple choice Using Text Files
What is printed? String s="CS:AP:Java"; String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 13

Multiple choice Using Text Files
Which prints exactly…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 14

Multiple choice Using Text Files
What is printed? String s="A->B->C->D"; String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 15

Multiple choice Using Text Files
Which string delimiter fills the blank so the code prints Row0:red, Row1:green and Row2:blue on separate lines? String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 16

Multiple choice Using Text Files
What is printed? String s="id=42;user=alice;role=admin"; String[] kv=s.split(";"); String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 17

Multiple choice Using Text Files
What is printed? String s="2025/09/07"; String[] d=s.split("/");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 18

Multiple choice Using Text Files
Which prints the initials…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 19

Multiple choice Using Text Files
What is printed? String s="sec1:topicA,topicB,topicC"; String[] leftRight=s.split(":"); String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 20

Multiple choice Using Text Files
Which prints d-c-b-a from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 11 of 181
Page 2 of 19