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

How many unique substrings can be formed from "boolean" that include both characters 'b' and 'n' exactly once?

Question 2
college-boardComputer Science AAPExam Style
1 mark

If a string variable word contains "examination", which of the following code segments will correctly output "nation"?

Question 3
college-boardComputer Science AAPExam Style
1 mark

Which method would you use to compare two strings for equality in Java?

Question 4
college-boardComputer Science AAPExam Style
1 mark

What is the result of concatenating two strings, "Java" and "Fun", using the '+' operator?

Question 5
college-boardComputer Science AAPExam Style
1 mark

Consider a string object defined as follows String sequence = “0102010”;, which operation would correctly determine how many times ‘02’ appears in sequence?

Question 6
college-boardComputer Science AAPExam Style
1 mark

How do you find the length of a string "Hello" in Java?

Question 7
college-boardComputer Science AAPExam Style
1 mark

If you want to convert an integer variable named score to a String, which method would you use?

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 does the expression "ComputerScience".substring(8).length() return?

Question 9
college-boardComputer Science AAPExam Style
1 mark

How do you convert all characters in a string object to lowercase in Java?

Question 10
college-boardComputer Science AAPExam Style
1 mark

If you execute String s = new StringBuilder("recursion").reverse().toString().toUpperCase();, what value does s represent?