Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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 2,981–2,990 of 3,140
  1. 2981
  2. 2982
  3. 2983
  4. 2984
  5. 2985
  6. 2986
  7. 2987
  8. 2988
  9. 2989
  10. 2990

Question 2981

Multiple choice Unit 4: Data Collections
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 2982

Multiple choice Unit 4: Data Collections
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 2983

Multiple choice Unit 4: Data Collections
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 2984

Multiple choice Unit 4: Data Collections
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 2985

Multiple choice Unit 4: Data Collections
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 2986

Multiple choice Unit 4: Data Collections
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 2987

Multiple choice Unit 4: Data Collections
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 2988

Multiple choice Unit 4: Data Collections
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 2989

Multiple choice Unit 4: Data Collections
A text file contains three lines: a,b,c,d e,f,g h,i What is printed? int total = 0; while (sc.hasNext()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2990

Multiple choice Unit 4: Data Collections
Consider the following class. public class Student { private String name; private int grade; public Student(String name, int grade) { this.name = name;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,981 of 3,140
Page 299 of 314