Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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.

Questions 961–970 of 1,079
  1. 961
  2. 962
  3. 963
  4. 964
  5. 965
  6. 966
  7. 967
  8. 968
  9. 969
  10. 970

Question 961

Multiple choice Using Text Files
A text file contains three lines: A,1 B,2 C,3 What is printed? int sum = 0; while (sc.hasNext()) { String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 962

Multiple choice Using Text Files
A text file contains: start,middle,end. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 963

Multiple choice Using Text Files
A text file contains: 10.0,20.0,30.0. What is printed? String line = sc.nextLine(); sc.close(); String[] parts = line.split(",");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 964

Multiple choice Using Text Files
A text file contains: AB,CDE,F. What is printed? String line = sc.nextLine(); sc.close(); String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 965

Multiple choice Using Text Files
A text file contains: X,Y,Z. What is printed? String line = sc.nextLine(); sc.close(); String[] parts = line.split(",");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 966

Multiple choice Using Text Files
A text file contains: 7,2. What is printed? String line = sc.nextLine(); sc.close(); String[] parts = line.split(",");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 967

Multiple choice Using Text Files
A text file contains: one-two-three four-five. What is printed? String token =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 968

Multiple choice Using Text Files
A text file contains two lines: name:Alice score:95 What is printed? int score = 0; while (sc.hasNext()) { String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 969

Multiple choice Using Text Files
A text file contains: 3,8,12. What is printed? String line = sc.nextLine(); sc.close(); String[] parts = line.split(","); int max =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 970

Multiple choice Using Text Files
A text file contains: 2026-03-25. What is printed? String line = sc.nextLine(); sc.close(); String[] parts =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 961 of 1,079
Page 97 of 108