1510 Chapter 2

1510 Chapter 2

University

41 Qs

quiz-placeholder

Similar activities

Mid Term Exam SEM I 2020 2021

Mid Term Exam SEM I 2020 2021

University

40 Qs

IOT_SARS

IOT_SARS

University

40 Qs

Information Technology, the Internet, and You

Information Technology, the Internet, and You

12th Grade - University

46 Qs

Boolean Algebra

Boolean Algebra

University

39 Qs

A+ 1101 P3

A+ 1101 P3

University

39 Qs

CNC Machine Production

CNC Machine Production

University

40 Qs

Ujian Informatika Kelas IX

Ujian Informatika Kelas IX

9th Grade - University

39 Qs

Informática

Informática

University

37 Qs

1510 Chapter 2

1510 Chapter 2

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Bhavnoor Saroya

Used 19+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

41 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If x is a String, then x = new String("OH"); and x = "OH"; will accomplish the same thing.

True

False

Answer explanation

fun fact: this is the "most correct" answer by Bruce's standards, but they dont quite do the same thing. Strings of the same value initialized via literals end up referencing the same bytes in memory. This is called "string pooling". Using the String constructor guarantees that new memory will be allocated for the String.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If x is the String "Hi There", then x.toUpperCase().toLowerCase(); will return the original value of x.

True

False

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If String name = "Bruce"; then the instruction name.length(); will return 5.

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If String a = "ABCD" and String b = "abcd" then a.equals(b); returns false but a.equalsIgnoreCase(b); returns true.

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Unlike the String class where you must pass a message to an object (instance) of the class, as in x.length(), in order to use either the Scanner or Math classes, you pass messages directly to the class name, as in Math.abs() or scan.nextInt().

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In order to generate a random number, you must use Math.random().

True

False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A double is wider than a float and a float is wider than an int.

True

False

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?