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.

Questions 1,061–1,070 of 1,222
  1. 1061
  2. 1062
  3. 1063
  4. 1064
  5. 1065
  6. 1066
  7. 1067
  8. 1068
  9. 1069
  10. 1070

Question 1061

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 1062

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 1063

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 1064

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 1065

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 1066

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 1067

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 1068

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 1069

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 1070

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 1,061 of 1,222
Page 107 of 123