Exam 11: More Object Oriented Programming Concepts

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

When properly used, inheritance always involves a ____ relationship.

Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
Verified

B

Programmers use the phrase ____ to describe what happens when worthless or invalid input causes inaccurate or unrealistic results.

Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
Verified

D

List three advantages of creating a useful, extendable superclass.

Free
(Essay)
4.8/5
(37)
Correct Answer:
Verified

Subclass creators save development time because much of the code needed for the class has already been written.
Subclass creators save testing time because the superclass code has already been tested and probably used in a variety of situations. In other words, the superclass code is reliable.
Programmers who create or use new subclasses already understand how the superclass works, so the time it takes to learn the new class features is reduced.
When you create a new subclass, neither the superclass source code nor the translated superclass code is changed. The superclass maintains its integrity.

A(n) ____ in a class diagram indicates public access.

(Multiple Choice)
4.9/5
(33)

When using existing objects, you need to concentrate only on the interface to those objects, not on the internal instructions that make them work.

(True/False)
4.7/5
(27)
Match each term with a statement below.
Used when you want no outside classes to be able to use a data field, except classes that are children of the original class
destructor
A class from which you cannot create any concrete objects, but from which you can inherit
catch block
A method that has the same name as a class and that establishes an object
protected access specifier
Correct Answer:
Verified
Premises:
Responses:
Used when you want no outside classes to be able to use a data field, except classes that are children of the original class
destructor
A class from which you cannot create any concrete objects, but from which you can inherit
catch block
A method that has the same name as a class and that establishes an object
protected access specifier
When a class contains objects of another class
abstract
Errors in object-oriented languages
throw statement
Sends an Exception object out of the current code block or method so it can be handled elsewhere
libraries
Collections of classes that serve related purposes
composition
A block of code you attempt to execute while acknowledging that an exception might occur
try block
Contains the actions you require when an instance of a class is destroyed
constructor
A segment of code that can handle an exception that might be thrown by the try block that precedes it
exceptions
(Matching)
4.7/5
(38)

In object-oriented terminology, "default constructor" means a constructor with a single standard parameter.

(True/False)
4.7/5
(25)

Programmers sometimes refer to a situation in which nothing goes wrong as the ____ case.

(Multiple Choice)
4.8/5
(42)

In object-oriented terminology, the generic name used for errors is ____.

(Multiple Choice)
4.9/5
(46)

An instance of a class becomes eligible for destruction when it is no longer possible for any code to use it-that is, when it goes out of ____________________.

(Short Answer)
4.9/5
(40)

Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.

(Multiple Choice)
4.7/5
(44)

Any constructor you write must have the same name as the class it constructs, and it cannot have a return type.

(True/False)
4.8/5
(26)

By using ____, you can use reasonable, easy-to-remember names for methods and concentrate on their purpose rather than on memorizing different method names.

(Multiple Choice)
4.7/5
(40)

In some programming languages, such as C#, Visual Basic, and Java, every class you create is a child of one ultimate base class, often called the ____ class.

(Multiple Choice)
4.8/5
(41)

When you purchase or download a(n) ____ for an object-oriented programming language, it comes packaged with many predefined, built-in classes.

(Multiple Choice)
4.9/5
(45)

Object-oriented programs employ a more specific group of techniques for handling errors called ____.

(Multiple Choice)
4.9/5
(33)

When you create a segment of code in which something might go wrong, you place the code in a ____ block.

(Multiple Choice)
4.8/5
(39)

You almost always code at least one catch block immediately following a(n) ____________________ block.

(Short Answer)
4.8/5
(36)

The entire list of parent classes from which a child class is derived constitutes the ____ of the subclass.

(Multiple Choice)
4.8/5
(37)

An abstract class is one from which you can create any concrete objects and from which you can inherit.

(True/False)
4.7/5
(38)
Showing 1 - 20 of 51
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)