1510 Chapter 2

1510 Chapter 2

University

41 Qs

quiz-placeholder

Similar activities

Operating System Concepts

Operating System Concepts

University

37 Qs

KUIS SISTEM OPERASI

KUIS SISTEM OPERASI

University

40 Qs

network

network

University

42 Qs

Midterm Exam ICTC1023

Midterm Exam ICTC1023

University

40 Qs

DSA QUIZ - 2 (17-06-23)

DSA QUIZ - 2 (17-06-23)

University

40 Qs

CSC 306 FINAL

CSC 306 FINAL

University

40 Qs

WINDOWS 10

WINDOWS 10

University

41 Qs

First  QUIZ of Database - Edited by: Eng. Javier Daza 2023-1

First QUIZ of Database - Edited by: Eng. Javier Daza 2023-1

University

40 Qs

1510 Chapter 2

1510 Chapter 2

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Bhavnoor Saroya

Used 26+ 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

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?

Discover more resources for Computers