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

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

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

Question 3
college-boardComputer Science AAPExam Style
1 mark

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

Question 4
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 5
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?

Question 6
college-boardComputer Science AAPExam Style
1 mark

Given String str = "Test123Test";, what does str.substring(4,7) return?

Question 7
college-boardComputer Science AAPExam Style
1 mark

To access a substring of a string, what indices do you need to specify in the substring() method?

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

What is returned when calling "Hello".indexOf('o')?

Question 9
college-boardComputer Science AAPExam Style
1 mark

Given the code snippet String phrase = "StudySession";, which operation would return the index of the first occurrence of 'S' after the fifth position?

Question 10
college-boardComputer Science AAPExam Style
1 mark

What is returned when calling the indexOf() function on string 'compute' with argument ā€˜p’ ?