t&f Java chapters

Ace your homework & exams now with Quizwiz!

A class is not an object, but a description of an object.

T

A common technique for writing an event listener class is to write it as a private inner class inside the class that creates the GUI.

T

A constructor is a method that is automatically called when an object is created.

T

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

T

A method that stores a value in a class's field or in some other way changes the value of a field is known as a mutator method.

T

A parameter variable's scope is the method in which the parameter is declared.

T

A sorting algorithm is a technique for scanning through an array and rearranging its contents in some specific order.

T

A value-returning method can return a reference (a reference holds memory address of object) to a non-primitive type . Primitive value arguments are passed by value (copy of argument value is passed into parameter)

T

An ArrayList object automatically expands in size to accommodate the items stored in it.

T

An access specifier indicates how the class may be accessed.

T

An object can store data.

T

Any items typed on the command-line, separated by space, after the name of the class are considered to be one or more arguments that are to be passed into the main method.

T

Any method that calls a method with a throws clause in its header must either handle the potential exception or have the same throws clause.

T

Check boxes may be grouped in a ButtonGroup, like radio buttons are.

T

Constants, variables, and the values of expressions may be passed as arguments to a method.

T

Declaring an array reference variable does not create an array.

T

Instance methods do not have the key word static in their headers.

T

Java does not limit the number of dimensions that an array may have.

T

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

T

Methods are commonly used to break a problem into small manageable pieces.

T

No statement outside the method in which a parameter variable is declared can access the parameter by its name.

T

Objects in an array are accessed with subscripts, just like any other data type in an array.

T

Once an array is created, its size cannot be changed.

T

Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.

T

Some of the common GUI components are buttons, labels, text fields, check boxes, and radio buttons.

T

The ActionEvent argument that is passed to an action listener's actionPerformed method is the event object that was generated in response to an event.

T

The String[] args parameter in the main method header allows the program to receive arguments from the operating system command-line.

T

The System.exit method will end the application.

T

The ability to display splash screens was introduced in Java 6.

T

The do-while loop must be terminated with a semicolon.

T

The expression in a return statement can be any expression that has a value.

T

The java.lang package is automatically imported into all Java programs.

T

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.

T

To compare the contents of two arrays, you must compare the elements of the two arrays.

T

Two general categories of methods are void methods and value returning methods.

T

When an array of objects is declared, but not initialized, the array values are set to null.

T

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. If break statement encountered, loop stops and program jumps to statement following loop (bypassing conditions of loop).

T

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

T

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.

T

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

T

You must have a return statement in a value-returning method.

T

When a local variable in an instance method has the same name as an instance field, the instance field hides the local variable.

F

When a splash screen is displayed, the application does not load and execute until the user clicks the splash screen image with the mouse.

F

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.

F

You must use the statement import java.swing.*; in order to use the ItemListener interface.

F

A GUI program automatically stops executing when the end of the main method is reached.

F

A method that gets a value from a class's field but does not change it is known as a mutator method.

F

A sorting algorithm is used to locate a specific item in a larger collection of data.

F

All operating systems offer the same set of GUI components.

F

An array can hold multiple values of several different data types simultaneously.

F

If a[] and b[] are two integer arrays, the expression a == b compares the array contents.

F

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

F

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

F

In the method header the static method modifier means the method is available to code outside the class.

F

In the method header, the method modifier public means that the method belongs to the class, not a specific object.

F

Instance methods should be declared static.

F

Java limits the number of dimensions that an array may have to 15.

F

Only constants and variables may be passed as arguments to methods.

F

The FlowLayout manager does not allow the programmer to align components.

F

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

F

The following statement adds the FlowLayout manager to the container, centers the components, and separates the components with a gap of 1 pixels. setLayout(new FlowLayout());

F

The public access specifier for a field indicates that the attribute may not be accessed by statements outside the class.

F

The term "default constructor" is applied to the first constructor written by the author of a class.

F


Related study sets

NURS 3005 Concepts - Exam 1 Review

View Set

Chemistry - The Modern Atomic Theory

View Set

Market Equilibrium and Policy - Econ 2302

View Set

Les loisirs et le temps libre- hobbies and free time

View Set

Chapter 69 - ASSESSMENT OF THE REPRODUCTIVE SYSTEM

View Set

Introduction to Sociology Chapter 1

View Set

The Paper Chase: Cumulative Knowledge

View Set

Prep U Chapter 34: Assessment and Management of Patients with Inflammatory Rheumatic Disorders

View Set