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.

Questions 281–290 of 776
  1. 281
  2. 282
  3. 283
  4. 284
  5. 285
  6. 286
  7. 287
  8. 288
  9. 289
  10. 290

Question 281

Multiple choice Using Objects
Consider the following method that is intended to remove all Strings from words that are less than six letters long. public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 282

Multiple choice Using Objects
Consider the following code segment. int varA = - 30; int varB = 30; while (varA != 0 || varB > 0) { varA = varA + 2; varB =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 283

Multiple choice Using Objects
The following incomplete code is intended to count the number of times the letter key is found in phrase. public static int countOccurrences (String phrase,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 284

Multiple choice Using Objects
Assume str1 and str2 are correctly initialized String variables. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 285

Multiple choice Using Objects
Assume names is a String array. Which statement…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 286

Multiple choice Using Objects
Consider the following method. public int countLetters(String word, String letter) { int count = 0; for (int index = 0;index < word.length();index++) { if ( /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 287

Free response Using Objects
In the seventeenth century, Location Numerals were invented as a new way to represent numbers. Location Numerals have a lot in common with the binary number…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 288

Multiple choice Using Objects
Consider the following code segment. String newString = "Welcome"; String anotherString = "Home"; newString =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 289

Multiple choice Using Objects
What is printed as a result of executing the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 290

Multiple choice Using Objects
Consider the following code segment. String str1 = "presto chango"; String str2 = "abracadabra"; int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 281 of 776
Page 29 of 78