int len = "jump it!".length();
What is the value of len?
Java Strings
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
ELIZABETH DIERKER
Used 488+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
int len = "jump it!".length();
What is the value of len?
8
7
9
6
This code does not compile.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int x = "quarantine".indexOf("a");
What is the value of x?
4
3
2
This code does not compile.
StringIndexOutOfBoundsException
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
String s = "whatever".substring(1,4);
What is the value of s?
"hate"
"hat"
"whate"
"what"
StringIndexOutOfBoundsException
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
String s1 = "hello";
String s2 = new String("hello");
if (s1 == s2) System.out.print("Hey");
else System.out.print("Yo");
What is the output?
Hey
Yo
There is no output.
This code will not compile.
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
int p = "Go Paw Patrol!".indexOf("p");
What is the value of p?
0
4
3
-1
This code will not compile.
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
String s = "cool cat".substring(6);
What is the value of s?
"cat"
"at"
"cool c"
This code does not compile.
StringIndexOutOfBoundsException
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int x = "Mary".compareTo("Molly");
if (x>=0) System.out.print("Yes");
else System.out.print("No");
What is the output?
Yes
No
There is no output.
This code will not compile.
10 questions
String Methods
Quiz
•
9th - 12th Grade
15 questions
Chapter 8 String Manipulations
Quiz
•
12th Grade
10 questions
10 câu kiểu xâu tiết 1
Quiz
•
11th Grade
11 questions
Python strings
Quiz
•
8th - 9th Grade
10 questions
Python Boolean and If
Quiz
•
9th - 12th Grade
13 questions
APCSA Unit 3 Review
Quiz
•
9th - 12th Grade
10 questions
STRING HANDLING
Quiz
•
10th Grade
10 questions
AP CSA 4.2 (For Loops)
Quiz
•
10th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
26 questions
June 19th
Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
27 questions
STAAR English 1 Review
Quiz
•
9th Grade