
Java Substring 10.18
Quiz
•
Computers
•
10th Grade
•
Practice Problem
•
Hard
Arasaka Teacher
Used 1+ times
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Code.org Unit 5 Lesson 15 Assessment
Quiz
•
9th - 12th Grade
16 questions
Python Review
Quiz
•
9th - 12th Grade
15 questions
Pemrograman Berorientasi Objek
Quiz
•
10th Grade
10 questions
CHƯƠNG TRÌNH CON BT1
Quiz
•
10th - 12th Grade
15 questions
Variables, Constants, and Data Types
Quiz
•
10th Grade
10 questions
Code.org Unit 5 Vocab Quiz 1
Quiz
•
9th - 12th Grade
10 questions
Variables and Data Types
Quiz
•
10th - 12th Grade
16 questions
LA3.C3: Variables
Quiz
•
9th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
