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 271–280 of 546
  1. 271
  2. 272
  3. 273
  4. 274
  5. 275
  6. 276
  7. 277
  8. 278
  9. 279
  10. 280

Question 271

Free response Using Objects
This question involves two classes that are used to process log messages. A list of sample log messages is given below. CLIENT3:security alert - repeated login…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 272

Multiple choice Using Objects
Consider the following code segment: String str = "012345"; for (int i = 0; i < str.length() - 1; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 273

Multiple choice Using Objects
What is the output from the following code? String s = "Computer Science is fun!"; String s1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 274

Free response Using Objects
A high school Casino Night event offers a game of chance in which a player can buy a ticket to have a low-probability chance at winning a fixed prize. (All…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 275

Multiple choice Using Objects
Given the following code segment: String s1 = new String("hi"); String s2 = new String("hi"); String s3 = s2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 276

Multiple choice Using Objects
Consider the following code segment: String s1 = "Hi There"; String s2 = s1; String s3 = s2; String s4 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 277

Multiple choice Using Objects
Given the following code segment: String s = "Computer Science is fun!"; String s1 = s.substring(0,8); String s2…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 278

Multiple choice Using Objects
Consider the following code segment: String s1 = new String("hi"); String s2 = new String("hi there"); String s3 = s2.substring(0, 2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 279

Multiple choice Using Objects
Consider the following code segment: public static void test(String str, int y) { str = str + "bow"; y = y *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 280

Multiple choice Using Objects
Consider the following code segment: String str = "mnopqr"; for (int x = 0; x < str.length() - 1; x++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 271 of 546
Page 28 of 55