Search Header Logo

Misconceptions Check

Authored by Manuel Alvarez

Computers

9th - 12th Grade

Used 8+ times

Misconceptions Check
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What do you use to compare Strings?

=

==

.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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?