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,051–1,060 of 1,222
  1. 1051
  2. 1052
  3. 1053
  4. 1054
  5. 1055
  6. 1056
  7. 1057
  8. 1058
  9. 1059
  10. 1060

Question 1051

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 1052

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 1053

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 1054

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 1055

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 1056

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 1057

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 1058

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 1059

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 1060

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 1,051 of 1,222
Page 106 of 123