Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice questions on Using Objects and Methods, 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 Objects Clear filter

Questions 401–410 of 546
  1. 401
  2. 402
  3. 403
  4. 404
  5. 405
  6. 406
  7. 407
  8. 408
  9. 409
  10. 410

Question 401

Multiple choice Using Objects

Consider the following code segment.

String s = "method";
String t = s.substring(2);
int value = t.length() + s.indexOf(t.substring(1, 3));

What value is stored in value?

Pick an answer, then check it. The solution opens in a window.

Question 402

Multiple choice Using Objects
Consider the following code segment. double r = Math.pow(2, 3)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 403

Multiple choice Using Objects
Consider the following code segment. String s = "starter"; String t = s.substring(0, 3) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 404

Free response Using Objects
This problem involves the design of two classes that work together to analyze the letters in a word. The following LetterFrequency class is provided. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 405

Free response Using Objects
This problem involves writing methods that examine a password for security requirements. The declaration of the PasswordChecker class is shown below. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 406

Free response Using Objects
This problem involves writing methods that format and inspect a sentence. The declaration of the TextFormatter class is shown below. public class TextFormatter…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 407

Free response Using Objects
This question involves parts used to assemble toy vehicles. Each toy vehicle is assembled using one base and either two or four wheels. The following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 408

Multiple choice Using Objects
What is printed by the following code segment? String s = "computer"; String t…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 409

Multiple choice Using Objects
What is printed by the following code segment? String w = "stream"; String x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 410

Multiple choice Using Objects
Consider the following declarations: String a = "Apple"; String b = "apple"; String c = "banana"; Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 401 of 546
Page 41 of 55