
HiT - Quiz 2
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Medium
Venkatesh iGen
Used 1+ times
FREE Resource
Enhance your content in a minute
26 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
20 sec • 1 pt
String s = "whatever".substring(1,4);
What is the value of s?
"hate"
"hat"
"whate"
"what"
StringIndexOutOfBoundsException
3.
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.
4.
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
5.
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.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
String s1 = "goat";
String s2 = s1.substring(0,s1.length());
boolean z = s1.equals(s2);
What is the value of z?
true
false
This code will not compile.
StringIndexOutOfBoundsException
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which code segment should go in the blank so that count is equal to the number of times "whoa" occurs in str?
str.length() -2
str.length() -4
str.length() - 3
str.length() - 1
str.length()
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
25 questions
PYTHON CONTEST
Quiz
•
University
24 questions
Kiểm tra giữa kì 2
Quiz
•
9th Grade
24 questions
Programim IX 2023
Quiz
•
9th Grade
22 questions
AS Data Types and Programming Constructs
Quiz
•
10th - 12th Grade
21 questions
OOP - session 2.1 - JVM, Array, Stack
Quiz
•
University
22 questions
1.3.4 Web Technologies
Quiz
•
12th Grade
25 questions
Python Module 1
Quiz
•
University
24 questions
UF1889 Documentación y manejo de errores.
Quiz
•
University - Professi...
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
