What do you use to compare Strings?
Misconceptions Check

Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Manuel Alvarez
Used 8+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
=
==
.equals()
&&
Answer explanation
= is for assigning values
== is for comparing primitive types (int, double, boolean, char)
.equals() is for comparing Objects/Strings
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What do you use to compare ints and doubles?
=
==
.equals()
||
Answer explanation
= is for assigning values
== is for comparing primitive types (int, double, boolean, char)
.equals() is for comparing Objects/Strings
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What do you use to compare chars and booleans?
=
==
.equals()
!
Answer explanation
= is for assigning values
== is for comparing primitive types (int, double, boolean, char)
.equals() is for comparing Objects/Strings
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following the correct way to initialize a String variable?
string str = "Monday";
String str = "Monday";
String str = 'Monday';
string str = 'Monday';
Answer explanation
String is a java class, unlike the primitive types (int, double, float, char). All classes should start with an uppercase letter. You know a String is a class because it has its own methods.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The indexes of elements in a Java array always start with _.
0
1
2
3
Answer explanation
When you construct an array int [] arr = new int[ 10 ] ; 10 refers to the length, which is the number of elements in the array. The index of those elements begins with 0.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the length of this String: "Bread"
2
3
4
5
Answer explanation
The length of a string is the number of characters in it. The index is the position of any character or set of characters within the string. Length starts counting with 1 and index starts with 0.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What index number is the "d" in the String: "Bread"
2
3
4
5
Answer explanation
The length of a string is the number of characters in it. The index is the position of any character or set of characters within the string. Length starts counting with 1 and index starts with 0.
Create a free account and access millions of resources
Similar Resources on Quizizz
14 questions
AP CSA Review

Quiz
•
11th Grade
12 questions
Java Strings

Quiz
•
9th - 12th Grade
20 questions
Pretest C++

Quiz
•
11th Grade
20 questions
Computer Application Practice Quiz Class 10

Quiz
•
10th Grade
10 questions
AP CS A Unit 6 Quiz PRACTICE

Quiz
•
9th - 12th Grade
17 questions
Arrays recap

Quiz
•
9th Grade - University
15 questions
Java Arrays Prt 1Quiz

Quiz
•
9th - 12th Grade
20 questions
Arrays in Java

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
20 questions
math review

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
10 questions
Human Body Systems and Functions

Interactive video
•
6th - 8th Grade
19 questions
Math Review

Quiz
•
3rd Grade
45 questions
7th Grade Math EOG Review

Quiz
•
7th Grade
Discover more resources for Computers
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
20 questions
Investing

Quiz
•
9th - 12th Grade
20 questions
EOC Math 1 Review

Quiz
•
9th Grade
20 questions
Insurance

Quiz
•
9th - 12th Grade
20 questions
MCAS Biology Review

Quiz
•
9th - 10th Grade
20 questions
Paying for College

Quiz
•
9th - 12th Grade
20 questions
Math 1 EOC Review

Quiz
•
9th Grade