Deck 11: More Object-Oriented Programming Concepts
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/60
Play
Full screen (f)
Deck 11: More Object-Oriented Programming Concepts
1
The most common way to declare a destructor explicitly is to use an identifier that consists of ____.
A) a colon followed by the class name
B) a period followed by the class name
C) a tilde followed by the class name
D) an exclamation mark followed by the class name
A) a colon followed by the class name
B) a period followed by the class name
C) a tilde followed by the class name
D) an exclamation mark followed by the class name
C
2
A class that is used as a basis for inheritance is called a ____ class or a superclass.
A) base
B) bottom
C) platform
D) derived
A) base
B) bottom
C) platform
D) derived
A
3
A(n)____ in a class diagram indicates public access.
A) minus sign
B) diamond
C) plus sign
D) exclamation point
A) minus sign
B) diamond
C) plus sign
D) exclamation point
C
4
Any constructor you write must have the same name as the class it constructs,and it cannot have a return type.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
5
You can create constructors for a class with or without parameters.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
6
It makes sense that a parent class object has access to its child's data and methods.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
7
A derived class always ____ case or instance of the more general base class.
A) has a
B) makes a
C) redefines a
D) is a
A) has a
B) makes a
C) redefines a
D) is a
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
8
An abstract class is one from which you can create any concrete objects and from which you can inherit.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
9
The built-in Exceptions in a programming language can cover every condition that might be an Exception in your applications.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
10
The entire list of parent classes from which a child class is derived constitutes the ____ of the subclass.
A) children
B) ancestors
C) subordinates
D) derivatives
A) children
B) ancestors
C) subordinates
D) derivatives
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
11
In object-oriented terminology,"default constructor" means a constructor with a single standard parameter.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
12
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.
A) Top
B) Object
C) Ultimate
D) Mega
A) Top
B) Object
C) Ultimate
D) Mega
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
13
The relationship created with composition is called a(n)____ relationship.
A) is-a
B) has-a
C) with-a
D) child
A) is-a
B) has-a
C) with-a
D) child
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
14
A method's name and a list of argument types together are its ____.
A) signature
B) header
C) profile
D) interface
A) signature
B) header
C) profile
D) interface
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
15
You cannot provide parameters to a destructor;it must have an empty parameter list.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
16
If a constructor requires arguments,it is a ____ constructor.
A) reliable
B) private
C) default
D) nondefault
A) reliable
B) private
C) default
D) nondefault
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
17
When properly used,inheritance always involves a ____ relationship.
A) specific-to-general
B) general-to-specific
C) specific-to-specific
D) general-to-general
A) specific-to-general
B) general-to-specific
C) specific-to-specific
D) general-to-general
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
18
By using standard component classes,programmers are assured that the GUI components in their programs have the same look and feel as those in other programs.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
19
When using existing objects,you need to concentrate only on the interface to those objects,not on the internal instructions that make them work.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
20
In OOP languages,a default constructor is created automatically by the compiler for every class you write.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
21
The capability to inherit from more than one class is called ____ inheritance.
A) poly
B) multiple
C) branch
D) dual
A) poly
B) multiple
C) branch
D) dual
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
22
Programmers use the phrase ____ to describe what happens when worthless or invalid input causes inaccurate or unrealistic results.
A) WIGO
B) GOGI
C) LIFO
D) GIGO
A) WIGO
B) GOGI
C) LIFO
D) GIGO
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
23
In object-oriented terminology,the generic name used for errors is ____.
A) bugs
B) undefined branches
C) interfaces
D) exceptions
A) bugs
B) undefined branches
C) interfaces
D) exceptions
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
24
Object-oriented programs employ a more specific group of techniques for handling errors called ____.
A) exception raising
B) exception management
C) exception handling
D) garbage collection
A) exception raising
B) exception management
C) exception handling
D) garbage collection
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
25
Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.
A) robust
B) innovative
C) fragile
D) constructive
A) robust
B) innovative
C) fragile
D) constructive
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
26
When you create a segment of code in which something might go wrong,you place the code in a ____ block.
A) throw
B) hold
C) try
D) catch
A) throw
B) hold
C) try
D) catch
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
27
____________________ is the mechanism by which a child class method is used by default when a parent class contains a method with the same signature.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
28
When a data field within a class is ____,no outside class can use it-including a child class.
A) reliable
B) fragile
C) private
D) protected
A) reliable
B) fragile
C) private
D) protected
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
29
When using ____________________,you can develop new classes more quickly by extending classes that already exist and work.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
30
When you purchase or download a(n)____ for an object-oriented programming language,it comes packaged with many predefined,built-in classes.
A) compiler
B) IDE
C) sunny day case
D) interpreter
A) compiler
B) IDE
C) sunny day case
D) interpreter
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
31
Code that has already been tested and used in a variety of situations is said to be ____.
A) protected
B) private
C) overloaded
D) reliable
A) protected
B) private
C) overloaded
D) reliable
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
32
Libraries,collections of classes that serve related purposes,are also called ____________________.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
33
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 ____________________.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
34
If an exception is thrown,it is passed to a block of code that can ____,which means to receive it in a block that can handle the problem.
A) catch the exception
B) raise the exception
C) hold the exception
D) try the exception
A) catch the exception
B) raise the exception
C) hold the exception
D) try the exception
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
35
In traditional programming,probably the most often used error-handling outcome was to ____.
A) terminate the program in which the offending statement occurred
B) ignore the error
C) handle the error
D) ask the user for additional input
A) terminate the program in which the offending statement occurred
B) ignore the error
C) handle the error
D) ask the user for additional input
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
36
____ are stored collections of classes that serve related purposes
A) Libraries
B) Constructors
C) IDE
D) Destructors
A) Libraries
B) Constructors
C) IDE
D) Destructors
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
37
By using ____,you can use reasonable,easy-to-remember names for methods and concentrate on their purpose rather than on memorizing different method names.
A) inheritance
B) inference
C) polymorphism
D) relationships
A) inheritance
B) inference
C) polymorphism
D) relationships
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
38
You almost always code at least one catch block immediately following a(n)____________________ block.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
39
Programmers sometimes refer to a situation in which nothing goes wrong as the ____ case.
A) rainbow day
B) sunny day
C) cloudy day
D) pessimistic
A) rainbow day
B) sunny day
C) cloudy day
D) pessimistic
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
40
In several languages,the visual development environment is known by the acronym ____.
A) IDE
B) XML
C) ODI
D) IPE
A) IDE
B) XML
C) ODI
D) IPE
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
41
Match each term with a statement below.
-A method that has the same name as a class and that establishes an object
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-A method that has the same name as a class and that establishes an object
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
42
Explain how to create your own throwable Exception.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
43
Match each term with a statement below.
-A block of code you attempt to execute while acknowledging that an exception might occur
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-A block of code you attempt to execute while acknowledging that an exception might occur
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
44
Describe the components of a try block.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
45
Explain composition.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
46
Match each term with a statement below.
-Contains the actions you require when an instance of a class is destroyed
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-Contains the actions you require when an instance of a class is destroyed
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
47
Match each term with a statement below.
-When a class contains objects of another class
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-When a class contains objects of another class
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
48
Discuss exception handling.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
49
Match each term with a statement below.
-Sends an Exception object out of the current code block or method so it can be handled elsewhere
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-Sends an Exception object out of the current code block or method so it can be handled elsewhere
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
50
Match each term with a statement below.
-Collections of classes that serve related purposes
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-Collections of classes that serve related purposes
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
51
List three advantages of creating a useful,extendable superclass.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
52
Match each term with a statement below.
-A class from which you cannot create any concrete objects,but from which you can inherit
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-A class from which you cannot create any concrete objects,but from which you can inherit
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
53
Explain inheritance.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
54
Discuss the general principle of exception handling in object-oriented programming.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
55
Explain constructors.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
56
List the elements you would use to create a catch block.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
57
Match each term with a statement below.
-A segment of code that can handle an exception that might be thrown by the try block that precedes it
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-A segment of code that can handle an exception that might be thrown by the try block that precedes it
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
58
Match each term with a statement below.
-Errors in object-oriented languages
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-Errors in object-oriented languages
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
59
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
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
-Used when you want no outside classes to be able to use a data field,except classes that are children of the original class
A)exceptions
B)composition
C)abstract
D)try block
E)destructor
F)libraries
G)catch block
H)protected access specifier
I)throw statement
J)constructor
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck
60
Describe the Object class.
Unlock Deck
Unlock for access to all 60 flashcards in this deck.
Unlock Deck
k this deck