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 951–960 of 1,079
  1. 951
  2. 952
  3. 953
  4. 954
  5. 955
  6. 956
  7. 957
  8. 958
  9. 959
  10. 960

Question 951

Multiple choice Using Text Files
A text file contains two lines: Name,Score Alice,95 The first line is a header. What is printed? sc.nextLine(); // skip header…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 952

Multiple choice Using Text Files
A text file contains: 2.5-3.5-4.0. 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 953

Multiple choice Using Text Files
A text file contains: 10,20,30,40,50. What is printed? String line = sc.nextLine();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 954

Multiple choice Using Text Files
A text file contains two lines: 1,2,3 4,5,6 What is printed? int sum = 0; while (sc.hasNext()) { String line =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 955

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 956

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 957

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 958

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 959

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 960

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 951 of 1,079
Page 96 of 108