Java True/False Chapter 3

Ace your homework & exams now with Quizwiz!

True

A local variable's scope always ends at the closing brace of the block of code in which it is declared.

True

An important style rule you should adopt for writing if statements is to write the conditionally executed statement on the line after the if statement.

False

An important style rule you should follow when writing if statements is to line up the conditionally executed statement with the if statement.

True

Because the && operator performs short-circuit evaluation, your boolean expression will usually execute faster if the subexpression that is most likely false is on the left of the && operator.

True

Because the || operator performs short-circuit evaluation, your boolean expression will generally be evaluated faster if the subexpression that is most likely to be true is on the left.

True

In a switch statement, each of the case values must be unique.

False

In a switch statement, if two different values for the CaseExpression would result in the same code being executed, you must have two copies of the code, one after each CaseExpression.

False

Programs never need more than one path of execution.

True

The String.format method works exactly like the System.out.printf method, except that it does not display the formatted string on the screen.

True

The System.out.printf method formats a string and displays it in the console window.

True

The if/else statement will execute one group of statements if its boolean expression is true or another group if its boolean expression is false.

True

Unicode is an international encoding system that is extensive enough to represent ALL the characters of ALL the world's alphabets.

False

When testing for character values, the switch statement does not test for the case of the character.

False

When two Strings are compared using the compareTo method, the cases of the two strings are not considered.


Related study sets

Chapter 37: Caring for Clients with Central and Peripheral Nervous System Disorders

View Set

EBIO Midterm #2 Practice Questions & Clickers

View Set

Nervous System Study Guide Plus Vocab and notes

View Set

SY0-401: Glossary, GSEC, SEC + 401 Study Guide COMBINED

View Set

Kin 236 Exam #2 Learning Objectives and Study Guide

View Set