
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
10 questions
Types of Computers
Quiz
•
9th - 10th Grade
13 questions
Cryptocurrency
Quiz
•
9th - 12th Grade
15 questions
Program Logic Test
Quiz
•
10th Grade
14 questions
Unit 5: Input in Java
Quiz
•
9th - 10th Grade
12 questions
Variables and data types
Quiz
•
4th - 12th Grade
10 questions
python-BTxâu
Quiz
•
9th - 12th Grade
10 questions
KS4 Programming Techniques (1)
Quiz
•
8th - 10th Grade
11 questions
J277 Programming - Data Types
Quiz
•
9th - 11th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
