
Strings quiz
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Hard
Ms STAFF
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
String s1 = "hello";
String s2 = "hel" + "lo";
System.out.println(s1 == s2);
true
false
compile time error
runtime error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following return?
String s1 = "hello";
String s2 = "hel";
String s3 = s2 + "lo";
System.out.println(s1 == s3);
true
false
compile time error
runtime error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
String s = "Java";
s.concat("World");
System.out.println(s);
JavaWorld
Java
World
Compiler error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the code?
String str1 = new String("Test");
String str2 = str1.intern();
System.out.println(str1 == str2);
true
false
compiler error
runtime error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method removes whitespace from both ends of a string?
removeWhiteSpace()
strip()
trim()
deleteSpace()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does String.valueOf(123) return?
123 as int
123.0
"123"
Compilation error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will this print?
String s = " ";
System.out.println(s.isBlank());
true
false
compiler error
exception
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
12 questions
Javascript Avanzado ft-22b Grupo 5
Quiz
•
Professional Development
10 questions
A+ Core 1 Printer Troubleshooting
Quiz
•
University - Professi...
14 questions
Network Fundamentals-Physical layer
Quiz
•
9th Grade - Professio...
7 questions
Review Class 11
Quiz
•
Professional Development
10 questions
Python Basics
Quiz
•
Professional Development
10 questions
PDS - 04225 Pointers & Dynamic Arrays - Chapter 8
Quiz
•
University - Professi...
10 questions
FP2: 02 - STRINGS
Quiz
•
Professional Development
15 questions
MASS STORAGE QUESTIONS
Quiz
•
9th Grade - Professio...
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
Discover more resources for Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
