Deck 12: Classes, Collections, and Inheritance

Full screen (f)
exit full mode
Question
The class is the portion of the class that is visible to the application programmer.

A) form
B) design
C) control
D) interface
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the following statements will remove an object referred to by the object variable NewStudent?

A) NewStudent = String.Empty
B) NewStudent = Nothing
C) NewStudent.Delete
D) Remove.NewStudent
Question
Which of the following operators determines if two object variables reference the same object?

A) =
B) IsEqual
C) Is
D) SameAs
Question
A constructor is a method named _found inside the class.

A) New
B) Constructor
C) Finalizer
D) the same as the class name
Question
The _property is used to get the number of items in a collection.

A) accumulator
B) enumerator
C) index
D) count
Question
You access public members of a class object with _.

A) the getData method
B) the access operator
C) the dot operator
D) a public module
Question
Which method is used to create a new item in a collection?

A) Store
B) Insert
C) Add
D) Create
Question
An instance of a class is also called ____.

A) a tangible entity
B) an object
C) a method
D) a property
Question
Which of the following displays a message box saying "I have been created" every time a new instance of the class ShowMe is created?

A) Public Class ShowMe MessageBox.Show"I have been created")
End Class
B) Public Class ShowMe Public Sub Constructor)
MessageBox.Show"I have been created")
End Sub
End Class
C) Public Class ShowMe Public Sub Create)
MessageBox.Show"I have been created")
End Sub
End Class
D) Public Class ShowMe Public Sub New)
MessageBox.Show"I have been created")
End Sub
End Class
Question
A variable declared inside a class is also known as a .

A) member variable
B) static variable
C) hidden variable
D) global variable
Question
Which of the following displays a window that lets you browse the classes available to your project?

A) Component Browser
B) Class Browser
C) Object Browser
D) Module Browser
Question
Object-oriented programming is a way of designing and coding applications such that interchangeable software can be used to build larger programs.

A) controls
B) structures
C) components
D) languages
Question
The hiding of data and procedures inside a class is achieved through a process called ___.

A) data enclosing
B) encapsulation
C) modularization
D) components
Question
Client programs can query _to get values, but they cannot modify them.

A) Read-Only properties
B) Get/Set properties
C) Private methods
D) Public properties
Question
All of the following statements are true about the .NET garbage collection utility except .

A) The garbage collector is a utility program that removes objects from memory that are no longer needed.
B) As the amount of available memory decreases, the garbage collector removes unreferenced objects more often.
C) The garbage collector removes an object from memory immediately when the last reference to it has been removed.
D) The system uses an algorithm to determine when it should periodically remove unused objects.
Question
A function that is a member of a class is called _.

A) a module
B) a method
C) a component
D) an element
Question
Class members declared with this access specifier are like private members, except they may be accessed by methods and property procedures in derived classes.

A) Private
B) Public
C) Protected
D) SubClass
Question
The following statements are true about user-defined collections except .

A) indexes for collections start at 0
B) collections can grow dynamically as items are inserted and removed
C) collections hold a variety of different objects
D) you can access the individual items in a collection using the Item property
Question
What happens when an object variable goes out of scope?

A) The object may be removed from memory by the garbage collector.
B) The object may be referred to using the dot operator.
C) An exception error will be generated.
D) The object becomes accessible again when the variable comes back into scope.
Question
When creating a ToString method to return a string representation of the data stored in an object, you must .

A) override the ToString method, which is inherited from the built-in Object class
B) add a Protected ToString method to the class
C) do nothing as the ToString method automatically performs this for each class
D) a ToString method is a reserved word that cannot be added to a class
Question
A _defines a special type of class member that contains Get and Set sections.

A) method
B) constructor
C) property procedure
D) member variable
Question
When using the Remove method of a collection, what happens if the argument provided is a string expression?

A) The item at the index value represented by that string is removed if found in the collection.
B) The item with a key value that matches the string is removed if found in the collection.
C) A string expression may not be provided as an argument.
D) A syntax error occurs.
Question
The _access specifier permits class members to be accessed by statements both outside the class and outside the assembly.

A) Public
B) Protected
C) Private
D) Friends
Question
Every class you create in Visual Basic is automatically derived from this built-in class.

A) Object
B) Base
C) Window
D) Application
Question
Why is important to remove objects that are no longer need in your program?

A) To prevent over writing new objects with old data.
B) To prevent program crashes
C) To free up memory for other uses.
D) So that you can reuse the variable name.
Question
It's possible to access the items in a collection using .

A) an integer index of the item to be retrieved
B) the Item method to retrieve an item with a specific key value
C) a For Each loop
D) all of the above
Question
The _ access specifier permits class members to be accessed only by statements inside the class.

A) Public
B) Protected
C) Private
D) Friend
Question
Object oriented analysis starts with .

A) declaring the member variables
B) finding the classes
C) describing attributes and operations
D) defining the property procedures
Question
A _is automatically called when an instance of the class is created.

A) Load method
B) constructor
C) instantiator
D) Initializer method
Question
An) ___is a class property that is defined by only a single line of code.

A) auto-implemented property
B) inline property
C) base property
D) derived property
Question
You can __ a method or property procedure found in the base class by adding one with the same name to a derived class.

A) Overrule
B) Substitute
C) Inherit
D) Override
Question
Which of the following describes the primary reason that one would override a property or method?

A) the property or method in the base class was declared as Private and can't be used
B) the property or method in the base class has an error
C) the property or method in the base class is not appropriate for the derived class
D) the property or method does not exist in the base class
Question
This key word is used to refer to properties and methods found in the base class.

A) Base
B) Me.Base
C) MyBase
D) Base.Class
Question
If there exists a class named People and one wants to create a new class named Student based on the People class, what code segment below shows the correct way to do so?

A) Public Class Student Inherits People
B) Public Class Student Includes Class People
C) Public Class Student based on People
D) Public Class Student :People
Question
_is a general model of something - it captures the general characteristics of an object.

A) A constructor
B) A collection
C) An instance
D) An abstraction
Question
The ___is a dialog box that displays information about objects.

A) Class window
B) Object Browser
C) Class properties window
D) OOP Viewer
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 12: Classes, Collections, and Inheritance
1
The class is the portion of the class that is visible to the application programmer.

A) form
B) design
C) control
D) interface
D
2
Which of the following statements will remove an object referred to by the object variable NewStudent?

A) NewStudent = String.Empty
B) NewStudent = Nothing
C) NewStudent.Delete
D) Remove.NewStudent
B
3
Which of the following operators determines if two object variables reference the same object?

A) =
B) IsEqual
C) Is
D) SameAs
C
4
A constructor is a method named _found inside the class.

A) New
B) Constructor
C) Finalizer
D) the same as the class name
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
5
The _property is used to get the number of items in a collection.

A) accumulator
B) enumerator
C) index
D) count
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
6
You access public members of a class object with _.

A) the getData method
B) the access operator
C) the dot operator
D) a public module
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
7
Which method is used to create a new item in a collection?

A) Store
B) Insert
C) Add
D) Create
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
8
An instance of a class is also called ____.

A) a tangible entity
B) an object
C) a method
D) a property
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
9
Which of the following displays a message box saying "I have been created" every time a new instance of the class ShowMe is created?

A) Public Class ShowMe MessageBox.Show"I have been created")
End Class
B) Public Class ShowMe Public Sub Constructor)
MessageBox.Show"I have been created")
End Sub
End Class
C) Public Class ShowMe Public Sub Create)
MessageBox.Show"I have been created")
End Sub
End Class
D) Public Class ShowMe Public Sub New)
MessageBox.Show"I have been created")
End Sub
End Class
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
10
A variable declared inside a class is also known as a .

A) member variable
B) static variable
C) hidden variable
D) global variable
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
11
Which of the following displays a window that lets you browse the classes available to your project?

A) Component Browser
B) Class Browser
C) Object Browser
D) Module Browser
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
12
Object-oriented programming is a way of designing and coding applications such that interchangeable software can be used to build larger programs.

A) controls
B) structures
C) components
D) languages
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
13
The hiding of data and procedures inside a class is achieved through a process called ___.

A) data enclosing
B) encapsulation
C) modularization
D) components
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
14
Client programs can query _to get values, but they cannot modify them.

A) Read-Only properties
B) Get/Set properties
C) Private methods
D) Public properties
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
15
All of the following statements are true about the .NET garbage collection utility except .

A) The garbage collector is a utility program that removes objects from memory that are no longer needed.
B) As the amount of available memory decreases, the garbage collector removes unreferenced objects more often.
C) The garbage collector removes an object from memory immediately when the last reference to it has been removed.
D) The system uses an algorithm to determine when it should periodically remove unused objects.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
16
A function that is a member of a class is called _.

A) a module
B) a method
C) a component
D) an element
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
17
Class members declared with this access specifier are like private members, except they may be accessed by methods and property procedures in derived classes.

A) Private
B) Public
C) Protected
D) SubClass
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
18
The following statements are true about user-defined collections except .

A) indexes for collections start at 0
B) collections can grow dynamically as items are inserted and removed
C) collections hold a variety of different objects
D) you can access the individual items in a collection using the Item property
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
19
What happens when an object variable goes out of scope?

A) The object may be removed from memory by the garbage collector.
B) The object may be referred to using the dot operator.
C) An exception error will be generated.
D) The object becomes accessible again when the variable comes back into scope.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
20
When creating a ToString method to return a string representation of the data stored in an object, you must .

A) override the ToString method, which is inherited from the built-in Object class
B) add a Protected ToString method to the class
C) do nothing as the ToString method automatically performs this for each class
D) a ToString method is a reserved word that cannot be added to a class
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
21
A _defines a special type of class member that contains Get and Set sections.

A) method
B) constructor
C) property procedure
D) member variable
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
22
When using the Remove method of a collection, what happens if the argument provided is a string expression?

A) The item at the index value represented by that string is removed if found in the collection.
B) The item with a key value that matches the string is removed if found in the collection.
C) A string expression may not be provided as an argument.
D) A syntax error occurs.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
23
The _access specifier permits class members to be accessed by statements both outside the class and outside the assembly.

A) Public
B) Protected
C) Private
D) Friends
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
24
Every class you create in Visual Basic is automatically derived from this built-in class.

A) Object
B) Base
C) Window
D) Application
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
25
Why is important to remove objects that are no longer need in your program?

A) To prevent over writing new objects with old data.
B) To prevent program crashes
C) To free up memory for other uses.
D) So that you can reuse the variable name.
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
26
It's possible to access the items in a collection using .

A) an integer index of the item to be retrieved
B) the Item method to retrieve an item with a specific key value
C) a For Each loop
D) all of the above
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
27
The _ access specifier permits class members to be accessed only by statements inside the class.

A) Public
B) Protected
C) Private
D) Friend
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
28
Object oriented analysis starts with .

A) declaring the member variables
B) finding the classes
C) describing attributes and operations
D) defining the property procedures
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
29
A _is automatically called when an instance of the class is created.

A) Load method
B) constructor
C) instantiator
D) Initializer method
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
30
An) ___is a class property that is defined by only a single line of code.

A) auto-implemented property
B) inline property
C) base property
D) derived property
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
31
You can __ a method or property procedure found in the base class by adding one with the same name to a derived class.

A) Overrule
B) Substitute
C) Inherit
D) Override
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
32
Which of the following describes the primary reason that one would override a property or method?

A) the property or method in the base class was declared as Private and can't be used
B) the property or method in the base class has an error
C) the property or method in the base class is not appropriate for the derived class
D) the property or method does not exist in the base class
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
33
This key word is used to refer to properties and methods found in the base class.

A) Base
B) Me.Base
C) MyBase
D) Base.Class
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
34
If there exists a class named People and one wants to create a new class named Student based on the People class, what code segment below shows the correct way to do so?

A) Public Class Student Inherits People
B) Public Class Student Includes Class People
C) Public Class Student based on People
D) Public Class Student :People
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
35
_is a general model of something - it captures the general characteristics of an object.

A) A constructor
B) A collection
C) An instance
D) An abstraction
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
36
The ___is a dialog box that displays information about objects.

A) Class window
B) Object Browser
C) Class properties window
D) OOP Viewer
Unlock Deck
Unlock for access to all 36 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 36 flashcards in this deck.