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 HANDLING
Quiz
•
10th Grade
10 questions
Strings
Quiz
•
11th Grade
15 questions
Microbit (python)
Quiz
•
8th - 10th Grade
15 questions
Python Lists
Quiz
•
10th - 12th Grade
15 questions
Python Unit 8 Quiz
Quiz
•
9th - 12th Grade
15 questions
Chapter 8 String Manipulations
Quiz
•
12th Grade
10 questions
Python Boolean and If
Quiz
•
9th - 12th Grade
13 questions
APCSA Unit 3 Review
Quiz
•
9th - 12th Grade
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
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