quiz5

¡Supera tus tareas y exámenes ahora con Quizwiz!

A programmer is required to define a constructor for every class.

False

A variable can always be referenced anywhere in a program.

False

An object can be thought of as a blueprint for a set of classes.

False

There are times when it is appropriate to return data from a method of a type that is inconsistent with the return type specified in the method header.

False

A main method can only access static or local variables.

True

A return statement is not required at the end of every method.

True

Aggregation is sometimes described as a has-a relationship

True

In a class that has variables called height and width, methods called getHeight() and getWidth() are examples of accessor methods.

True

Variables that are declared as static are shared among all instances of a class.

True

When an object is passed to a method, the actual and formal parameters become aliases.

True

A ________________ diagram helps us visualize the contents of and relationships among the classes of a program.

UML

All methods (with the exception of constructors) must specify a return type. What is the return type for a method that does not return any values?

Void

__________________ parameters are the values that are used when calling a method.

actual

A(n) ___________________ object is one that is made up, at least in part, of other objects.

aggregate

A(n) ________________ is a step-by-step process for solving a problem.

algorithm

Which of the following types of methods do not have any return type (not even a void return type)?

constructors

Which of the following object-oriented principles refers to the fact that an object should have its data guarded from inappropriate access?

encapsulation

A method that has multiple definitions is an __________________ method.

overloaded

If a service is so complex that it cannot be reasonably be implemented using one method, it is often helpful to decompose it to make use of ________________ support methods.

private

When applied to instance variables, the ________________ visibility modifier enforces encapsulation.

private

Which of the following method headers is most likely a header for a mutator method?

public void setAge(int newAge)

A _______________ variable is shared among all instances of a class.

static

Methods that can be called directly through the class name and do not need to have an object instantiated are called _________________.

static

The versions of an overloaded method are distinguished by ___________________________.

the number, type and order of their parameters

The ________________ reference always refers to the currently executing object.

this


Conjuntos de estudio relacionados

True or false proteins synthesis worksheet

View Set

UNIT 4: Urinary System (Mylab and Mastering)

View Set

Commutative, Associative & Identity Properties of Addition & Multiplication: vocabulary & examples

View Set

Tax Accounting Exam #2 (Chapters 5-7)

View Set

Teoría Jerarquía de Necesidades

View Set

PrepU Nursing Process and Assessment

View Set