`1`

Ace your homework & exams now with Quizwiz!

A Java program will not compile unless it contains the correct line numbers.

False

All Java statements end with semicolons.

False

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

False

Both character literals and string literals can be assigned to a char variable.

False

Class names and key words are examples of variable

False

Colons are used to indicate the end of a Java statement.

False

Compiled byte code is also called source code.

False

In Java the variable named total is the same as the variable named Total.

False

In a for statement, the control variable can only be incremented.

False

In the for loop, the control variable cannot be initialized to a constant value and tested against a constant value.

False

Java is a case-insensitive language.

False

Java source files end with the .class extension.

False

Programs never need more than one path of execution.

False

The contents of a variable cannot be changed while the program is running.

False

The do-while loop is a pre-test loop.

False

A computer is a tool used by so many professions that it cannot be easily categorized

True

A file must always be opened before using it and closed when the program is finished using it.

True

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

True

A variable's scope is the part of the program that has access to the variable.

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

Each byte is assigned a unique number known as an address.

True

Encapsulation refers to the combining of data and code into a single object.

True

If the compiler encounters a statement that uses a variable before the variable is declared, an error will result.

True

The while loop has two important parts: (1) a boolean expression that is tested for a true or false value, and (2) a statement or block of statements that is repeated as long as the expression is true.

True

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

True

When an object's internal data is hidden from outside code and access to that data is restricted to the object's methods, the data is protected from accidental corruption.

True

When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.

True

When you open a file with the PrintWriter class, the class can potentially throw an IOException.

True

When you pass the name of a file to the PrintWriter constructor, and the file already exists, it will be erased and a new empty file with the same name will be created.

True

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

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

False

When the break statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.

False

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

False

Although the dollar sign is a legal identifier character, you should not use it because it is normally used for special purposes.

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.

True

Application software refers to programs that make the computer useful to the user.

True

Assuming that pay has been declared a double, the following statement is valid.

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

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

True

Java provides a set of simple unary operators designed just for incrementing and decrementing variables.

True

Logical errors are mistakes that cause the program to produce erroneous results.

True

Named constants are initialized with a value, that value cannot be changed during the execution of the program.

True

Programming style includes techniques for consistently putting spaces and indentation in a program so visual cues are created.

True

The Java Virtual Machine is a program that reads Java byte code instructions and executes them as they are read.

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 do-while loop must be terminated with a semicolon

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

Without programmers, the users of computers would have no software, and without software, computers would not be able to do anything.

True

You can use the PrintWriter class to open a file for writing and write data to it.

True


Related study sets

Chapter 2: The Political, Legal and Technological Environment

View Set

CCNA Introduction to Networks Chapter 4

View Set

The Muscular System of the dog or cat

View Set

Advance MS Quiz #1 - ch 49, 65, 48 with a hint of ATI

View Set

ECON 2105 Unit 2: (Chp 6-9) Measurement, Finance, and Economic Growth

View Set

General Biology I Lab - Lab Safety Post Lab Questions

View Set

BADMA379 Ethics and Ethical Reasoning

View Set

Domain 8: Software Development Security

View Set

Chapter 3 - Analyzing Business Transactions Using T Accounts

View Set

Starting Out in C# - Chapter 3 Questions

View Set