Java Chapter 4 Quiz

Java Chapter 4 Quiz

University

10 Qs

quiz-placeholder

Similar activities

C Program Array and strings

C Program Array and strings

University

10 Qs

UAS Praktikum: Logika dan Algoritma Pemrograman

UAS Praktikum: Logika dan Algoritma Pemrograman

1st Grade - University

10 Qs

Python Prelims Test

Python Prelims Test

University

15 Qs

C programming-1

C programming-1

University

13 Qs

Java Basics

Java Basics

12th Grade - Professional Development

15 Qs

Java Programming

Java Programming

University

11 Qs

Kuizi 7.1

Kuizi 7.1

University

11 Qs

[Python for all] Quiz 3 - Strings

[Python for all] Quiz 3 - Strings

University

10 Qs

Java Chapter 4 Quiz

Java Chapter 4 Quiz

Assessment

Quiz

Computers

University

Medium

Created by

Alex Zaldivar

Used 94+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If str1 and str2 are both String objects, which of the following expressions will correctly determine whether or not they are equal?

str1 == str2

str1 && str2

str1.equals(str2)

str1 + str2

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In an if-else statement, if the boolean expression is false

no statements or blocks are executed.

the statement or block following the else is executed.

the first statement or block is executed.

all statements or blocks are executed.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be displayed when the following code is executed?

double x = 45678.259;

DecimalFormat formatter = new DecimalFormat("#,##0.0"); JOptionPane.showMessageDialog(null,formatter.format(x));

45,678.26

45,678.3

45,678.259

45678.259

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

________ operators are used to determine whether a specific relationship exists between two values.

Assignment

Arithmetic

Logical

Relational

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The boolean expression in an if statement must evaluate to

degrees or radians

true or false

positive or negative

left or right

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following expressions determines whether the char variable chrA is not equal to the letter 'A'?

chrA == 'A'

chrA != 'A'

chrA || 'A'

chrA.notEquals('A')

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Enclosing a group of statements inside a set of braces creates

an expression

a block of statements

a relational operator

an if-else statement

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?