
Java Substring 10.18

Quiz
•
Computers
•
10th Grade
•
Hard

Arasaka Teacher
Used 1+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
String str = "level nail";
System.out.println(str.substring(a,b) + str.substring(c));
Which values of a, b, and c will cause the program to output the word "evil"?
a=1 b=3 c=8
a=0 b=2 c=7
a=1 b=2 c=8
a=1 b=3 c=7
a=2 b=4 c=9
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
String s1 = "California Golden Bears";
String s2 = s1.substring(11, 13) + s1.substring(10, 11) + s1.substring(18) + "!";
What is the value of s2 after the code executes?
"Go Bears!"
"GoBears!"
" Gaa!"
"Go B!"
"Gol Bears!"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of pos after the following code executes?
String s1 = "abccba";
int pos = s1.indexOf("b");
2
1
4
-1
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of len after the following code executes?
String s1 = "baby";
int len = s1.length();
2
3
4
-1
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of s2 after the following code executes?
String s1 = "baby";
String s2 = s1.substring(0, 3);
baby
b
ba
bab
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of len after the following code executes?
String s1 = "Miss you!";
int len = s1.length();
7
8
9
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of s2 after the following code executes?
String s1 = "baby";
String s2 = s1.substring(2);
by
aby
a
b
ba
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
String Methods

Quiz
•
9th - 12th Grade
10 questions
24. XÂU KÍ TỰ

Quiz
•
10th Grade
15 questions
Quizz Xâu kí tự(tiết 1)

Quiz
•
10th Grade
6 questions
AP CSA Recursion (10.1)

Quiz
•
10th Grade
15 questions
ASK F2 -KOD ARAHAN (PYTHON)

Quiz
•
1st Grade - University
10 questions
Arrays

Quiz
•
10th - 12th Grade
15 questions
# REVIEW 1 DATA TYPES

Quiz
•
10th Grade
8 questions
Xâu 2

Quiz
•
10th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade