zuai-logo
zuai-logo
  1. AP Computer Science A
FlashcardFlashcardStudy GuideStudy GuideQuestion BankQuestion Bank

Using Objects in AP Computer Science A

Question 1
college-boardComputer Science AAPExam Style
1 mark

What does "Computer".substring(0,3) return?

Question 2
college-boardComputer Science AAPExam Style
1 mark

What method would you use to check if two strings are equal, ignoring the case?

Question 3
college-boardComputer Science AAPExam Style
1 mark

Considering String s = "iteration";, what is the result of s.length() + s.indexOf('n')?

Question 4
college-boardComputer Science AAPExam Style
1 mark

Which method returns a substring from index start up to but not including index end from the string info?

Question 5
college-boardComputer Science AAPExam Style
1 mark

What must be true about a non-empty string str if (str.substring(0, k) + str.substring(k)).equals(str) holds for all values of k where 0 <= k <= str.length()?

Question 6
college-boardComputer Science AAPExam Style
1 mark

Considering algorithms that concatenate characters from two strings alternatively (e.g., “abc” + “123” = “a1b2c3”), which method would be least efficient if implemented in Java?

Question 7
college-boardComputer Science AAPExam Style
1 mark

What is the index of the first character of a string?

Feedback stars icon

How are we doing?

Give us your feedback and let us know how we can improve

Question 8
college-boardComputer Science AAPExam Style
1 mark

Given two strings, strA = "APCALCULUS" and strB = "APPHYSICS", what will be the output for strA.compareTo(strB)?

Question 9
college-boardComputer Science AAPExam Style
1 mark

Which control structure should be utilized when determining whether a given string input starts with a certain prefix, without iterating through each character?

Question 10
college-boardComputer Science AAPExam Style
1 mark

Which statement will return true if a given string variable phrase contains at least three consecutive vowels anywhere within it?