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.

Subtopic: Using Text Files Clear filter

Questions 131–140 of 181
  1. 131
  2. 132
  3. 133
  4. 134
  5. 135
  6. 136
  7. 137
  8. 138
  9. 139
  10. 140

Question 131

Multiple choice Using Text Files
A text file contains: The quick brown fox jumps. What is printed? String line =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 132

Multiple choice Using Text Files
A text file contains: Java:is:fun. What is printed? String line = sc.nextLine(); sc.close();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 133

Multiple choice Using Text Files
A text file contains three lines: 10,20 30,40 50,60 What is printed? int sum = 0; while (sc.hasNext()) { String line = sc.nextLine(); String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 134

Multiple choice Using Text Files
A text file contains: cat,dog,cat,bird,cat. 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 135

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 136

Multiple choice Using Text Files
A text file contains: red|green|blue. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 137

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 138

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 139

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 140

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 131 of 181
Page 14 of 19