Choose the line that assigns "love" to str2.

APCSA Unit 2 String Methods

Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Sonia Coile
Used 2+ times
FREE Resource
39 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
str2 = str.substring(2,6);
str2 = str.substring(2,5);
str2 = str.substring(2);
str2 = str.substring(4);
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Choose the line that assigns "boba." to str2.
str2 = str.substring(7);
str2 = str.substring(7,11);
str2 = str.substring(8,12);
str2 = str.substring(8);
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Choose the line that assigns "I" to str2.
str2 = str.substring(0,1);
str2 = str.substring(1,2);
str2 = str.substring(0);
str2 = str.substring(1);
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the output from running this code block?
equals method
== operator
(Nothing)
equals method
== operator
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the result of running this code block?
"." is printed.
An exception is thrown.
"America." is printed.
"a" is printed.
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the result of running this code block?
"." is printed.
An exception is thrown.
"America." is printed.
"a" is printed.
7.
MULTIPLE SELECT QUESTION
3 mins • 1 pt
What method-call below could be used to determine whether str contains the String "States"? Choose all that apply.
str.contains("States")
str.indexOf("States")
str.equals("States")
str.compareTo("States")
Create a free account and access millions of resources
Similar Resources on Quizizz
34 questions
CB30: Unit 2 Test Review

Quiz
•
9th - 12th Grade
37 questions
AP CS A Midterm Review

Quiz
•
9th - 12th Grade
36 questions
AP CS A unit 1

Quiz
•
11th Grade - University
40 questions
Python Assessment 1

Quiz
•
7th - 9th Grade
40 questions
Python

Quiz
•
9th Grade
44 questions
python

Quiz
•
10th Grade
35 questions
Year 9 - Programming in Python Assessment

Quiz
•
9th Grade
35 questions
APCSA Unit 4 test

Quiz
•
9th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University