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 241–250 of 776
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

Multiple choice Using Objects
Consider the following code fragment. Object intObj = new Integer(9); System.out.println(intObj); You may…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 242

Multiple choice Using Objects
Consider these declarations. String s1 = "crab"; String s2 = new String("crab"); String s3 = s1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 243

Multiple choice Using Objects
Suppose that strA = "TOMATO", strB = "tomato", and strC = "tom".…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 244

Multiple choice Using Objects
This question refers to the following declaration. String line = "Some more silly stuff on strings!"; / / the words are separated by a single space What…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 245

Multiple choice Using Objects
A program has a String variable fullName that stores a first name, followed by a space, followed by a last name. There are no spaces in either the first or last…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 246

Multiple choice Using Objects
One of the rules for converting English to Pig Latin states: If a word begins with a consonant, move the consonant to the end of the word and add "ay". Thus…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 247

Multiple choice Using Objects
This question refers to the getString method shown below. public static String getString(String s1, String s2) { int index = s1.indexOf(s2); return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 248

Multiple choice Using Objects
public class Position { /** row and col are both >= 0 except in the default * constructor where they are initialized to -1. */ private int row, col; public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 249

Multiple choice Using Objects
Which boolean expression about p1 and p3 is true? I…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 250

Multiple choice Using Objects
public class IntPair { private int firstValue; private int secondValue; public IntPair(int first, int second) { firstValue = first; secondValue = second; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 241 of 776
Page 25 of 78