
Strings quiz

Quiz
•
Computers
•
Professional Development
•
Hard
Ms STAFF
Used 2+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
StreamQuiz

Quiz
•
Professional Development
10 questions
Python Basics: Dictionaries and Strings

Quiz
•
University - Professi...
10 questions
Python Basics

Quiz
•
Professional Development
15 questions
Linked List

Quiz
•
Professional Development
10 questions
Quiz

Quiz
•
Professional Development
8 questions
Static in Java

Quiz
•
Professional Development
10 questions
java

Quiz
•
Professional Development
10 questions
Uni-5 Quiz

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Computers
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
5 questions
Setting goals for the year

Quiz
•
Professional Development
14 questions
2019 Logos

Quiz
•
Professional Development
6 questions
GUM Chart Scavenger Hunt

Quiz
•
Professional Development
8 questions
Understanding Government: Limited and Unlimited

Quiz
•
Professional Development
20 questions
tape measure

Quiz
•
Professional Development
24 questions
Street Signs

Quiz
•
9th Grade - Professio...