Filters
Question type

Study Flashcards

One way to enforce preconditions is to ____.


A) use comments
B) declare them
C) use inheritance
D) throw an exception

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

A subclass often has methods that do not appear in its superclass.

A) True
B) False

Correct Answer

verifed

verified

Classes that are related by inheritance have a has-a relationship. ____________________

A) True
B) False

Correct Answer

verifed

verified

It is easier to maintain a program that uses interface types.

A) True
B) False

Correct Answer

verifed

verified

An abstract class is one that will not be instantiated. ____________________

A) True
B) False

Correct Answer

verifed

verified

When information needs to be shared among all instances of a class, that information can be represented in terms of ____________________ variables.

Correct Answer

verifed

verified

static

Characteristics common to several classes can be collected in a common abstract subclass. ____________________

A) True
B) False

Correct Answer

verifed

verified

An interface is a class.

A) True
B) False

Correct Answer

verifed

verified

FIGURE 11-1 FIGURE 11-1   -Figure 11-1 above shows an example of a ____ hierarchy. A)  class B)  interface C)  program D)  method -Figure 11-1 above shows an example of a ____ hierarchy.


A) class
B) interface
C) program
D) method

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

Identify the letter of the choice that best matches the phrase or definition. a.Dependency b.Extension c.Overriding d.Aggregation e.Inheritance -When an object of one class contains objects of another class as structural components.

Correct Answer

verifed

verified

____ provides a mechanism for reusing code and can reduce the effort required to implement a new class.


A) Aliasing
B) Inheritance
C) Polymorphism
D) Referencing

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

A class method is activated when a message is sent to the class rather than the object. ____________________

A) True
B) False

Correct Answer

verifed

verified

When you declare a variable, it should have a different interface name from the type name.

A) True
B) False

Correct Answer

verifed

verified

A class variable belongs to an object and is allocated storage when the object is created.

A) True
B) False

Correct Answer

verifed

verified

In general, a static variable is used in any situation in which all instances share a common data value.

A) True
B) False

Correct Answer

verifed

verified

Identify the letter of the choice that best matches the phrase or definition. a.Dependency b.Extension c.Overriding d.Aggregation e.Inheritance -When an object's class is a subclass of a more general class.

Correct Answer

verifed

verified

E

In Java, all classes are part of an immense hierarchy, with the class ____________________ at the root.

Correct Answer

verifed

verified

Object

To compare objects for equality, use the ____.


A) = = operator
B) equals method
C) compare operator
D) both a and b are true.

E) A) and B)
F) A) and D)

Correct Answer

verifed

verified

The most general type of array is one whose element type is ____.


A) String
B) Object
C) Shape
D) Int

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Identify the letter of the choice that best matches the phrase or definition. a.Dependency b.Extension c.Overriding d.Aggregation e.Inheritance -When the subclass method is intended as a replacement of the superclass method.

Correct Answer

verifed

verified

Showing 1 - 20 of 46

Related Exams

Show Answer