Deck 14: Creating Classes and Objects

Full screen (f)
exit full mode
Question
By convention, the names of the Private variables in a class start with a(n) ____.

A) slash ( / )
B) underscore ( _ )
C) pound sign ( # )
D) ampersand ( & )
Use Space or
up arrow
down arrow
to flip the card.
Question
A(n) ____ can represent something found in real life, such as a wristwatch or a car.

A) object
B) property
C) method
D) argument
Question
____ are the operations (actions) that the object is capable of performing.

A) Objects
B) Events
C) Methods
D) Arguments
Question
Each object is an instance of the ____ from which it is created.

A) parameter
B) class
C) procedure
D) variable
Question
In OOP, the term ____ means to enclose in a class.

A) abstract
B) encapsulate
C) inherit
D) incorporate
Question
The Private variables of a class are visible to applications that contain an instance of the class.
Question
The Get statement begins with the keyword Get and ends with the keywords Return Get.
Question
____ are the actions to which an object can respond.

A) Objects
B) Events
C) Methods
D) Arguments
Question
The ____ of a class are most often represented by Private variables and Public properties.

A) objects
B) methods
C) behaviors
D) attributes
Question
In Visual Basic, you can define your own classes and then create instances from those classes.
Question
To instantiate a class-level object variable, you use the ____ keyword.

A) Public
B) Dim
C) Private
D) Property
Question
The only type of method which can be overloaded is a constructor.
Question
A(n) ____ encapsulates all of the attributes and behaviors of the object it instantiates.

A) argument
B) procedure
C) parameter
D) class
Question
The ____ of a class are represented by methods, which can be Sub or Function procedures.

A) behaviors
B) attributes
C) objects
D) parameters
Question
The Class statement begins with ____.

A) the keywords Start Class, followed by the name of the class
B) the name of the class, followed by the keywords Start Class
C) the keywords Public Class, followed by the name of the class
D) the name of the class, followed by the keywords Public Class
Question
The Class statement ends with the ____ clause.

A) End Class
B) Public Class
C) Exit Class
D) Dim Class
Question
In its simplest form, the Class statement can be used in place of the Structure statement.
Question
When a variable in a class is declared using the ____ keyword, it can be accessed by any application that contains an instance of the class.

A) Module
B) Private
C) Dim
D) Public
Question
The convention is to use ____ case for the names of the Public variables in a class.

A) Camel
B) Pascal
C) AllCaps
D) SmallCaps
Question
You use the ____ keyword to instantiate a procedure-level object variable.

A) Public
B) Dim
C) Private
D) Property
Question
A constructor begins with the keywords ____.

A) Public Sub New
B) Public Constructor
C) Private Constructor
D) Private New
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Allows an application to assign a value to the Private variable associated with a property
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Allows an application to retrieve the contents of the Private variable associated with a property
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used to declare a variable that is not visible to applications that contain an instance of the class
Question
The classes that you define must specify the attributes and ____________________ of the objects they create.
Question
You can write a(n) ____ as either a Function procedure or a Sub procedure.

A) attribute
B) method
C) parameter
D) Property procedure
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used in a Property procedure header to indicate that you are creating a property whose value can be retrieved by an application but cannot be set by the application
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Characteristic that describes the object
Question
When an application needs to assign data to or retrieve data from a Private variable in a class, it must use a(n) ____ property to do so.

A) Private
B) Public
C) class
D) object
Question
The Set statement begins with the keyword Set and ends with the keywords ____.

A) End Set
B) Return Set
C) Complete Set
D) Exit Set
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used in a Property procedure header to indicate that an application can set the property's value, but it cannot retrieve the value
Question
You should use ____ to name a property.

A) nouns and verbs
B) verbs
C) adverbs and adjectives
D) nouns and adjectives
Question
Constructors that contain parameters are called ____________________ constructors.
Question
____ enable you to specify the property of a class in one line of code.

A) System properties
B) Auto-implemented properties
C) Restricted properties
D) Class-delivered properties
Question
After you define a class, you can then use the class to instantiate one or more ____________________.
Question
A constructor that has no parameters is called the ____________________ constructor.
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Can be used to create a Public property
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Includes methods and events
Question
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used to create an object
Question
An application cannot access the ____________________ variables in a class.
Question
How can you make the Private members of a class available to an application?
Question
What is meant by overloaded methods and when is overloading of methods useful?
Question
To allow for salaried employees that are paid on a schedule other than the standard, what is the header for the appropriate method to retrieve their gross salary?
Question
What is a method's signature?
Question
For the class Student, how you would create the auto-implemented string property of Firstname?
Question
What are the steps to add a class file to the current project?
Question
What are the rules for naming methods?
Question
Describe a Property procedure header.
Question
Although you can define a class that contains only attributes represented by Public variables, it is rarely done. Describe the disadvantage of using Public variables in a class.
Question
What is a constructor? What is the purpose of a constructor?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 14: Creating Classes and Objects
1
By convention, the names of the Private variables in a class start with a(n) ____.

A) slash ( / )
B) underscore ( _ )
C) pound sign ( # )
D) ampersand ( & )
B
2
A(n) ____ can represent something found in real life, such as a wristwatch or a car.

A) object
B) property
C) method
D) argument
A
3
____ are the operations (actions) that the object is capable of performing.

A) Objects
B) Events
C) Methods
D) Arguments
C
4
Each object is an instance of the ____ from which it is created.

A) parameter
B) class
C) procedure
D) variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
In OOP, the term ____ means to enclose in a class.

A) abstract
B) encapsulate
C) inherit
D) incorporate
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
The Private variables of a class are visible to applications that contain an instance of the class.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
The Get statement begins with the keyword Get and ends with the keywords Return Get.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
____ are the actions to which an object can respond.

A) Objects
B) Events
C) Methods
D) Arguments
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The ____ of a class are most often represented by Private variables and Public properties.

A) objects
B) methods
C) behaviors
D) attributes
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
In Visual Basic, you can define your own classes and then create instances from those classes.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
To instantiate a class-level object variable, you use the ____ keyword.

A) Public
B) Dim
C) Private
D) Property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
The only type of method which can be overloaded is a constructor.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
A(n) ____ encapsulates all of the attributes and behaviors of the object it instantiates.

A) argument
B) procedure
C) parameter
D) class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
The ____ of a class are represented by methods, which can be Sub or Function procedures.

A) behaviors
B) attributes
C) objects
D) parameters
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The Class statement begins with ____.

A) the keywords Start Class, followed by the name of the class
B) the name of the class, followed by the keywords Start Class
C) the keywords Public Class, followed by the name of the class
D) the name of the class, followed by the keywords Public Class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The Class statement ends with the ____ clause.

A) End Class
B) Public Class
C) Exit Class
D) Dim Class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
In its simplest form, the Class statement can be used in place of the Structure statement.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
When a variable in a class is declared using the ____ keyword, it can be accessed by any application that contains an instance of the class.

A) Module
B) Private
C) Dim
D) Public
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
The convention is to use ____ case for the names of the Public variables in a class.

A) Camel
B) Pascal
C) AllCaps
D) SmallCaps
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
You use the ____ keyword to instantiate a procedure-level object variable.

A) Public
B) Dim
C) Private
D) Property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
A constructor begins with the keywords ____.

A) Public Sub New
B) Public Constructor
C) Private Constructor
D) Private New
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Allows an application to assign a value to the Private variable associated with a property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Allows an application to retrieve the contents of the Private variable associated with a property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used to declare a variable that is not visible to applications that contain an instance of the class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The classes that you define must specify the attributes and ____________________ of the objects they create.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
You can write a(n) ____ as either a Function procedure or a Sub procedure.

A) attribute
B) method
C) parameter
D) Property procedure
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used in a Property procedure header to indicate that you are creating a property whose value can be retrieved by an application but cannot be set by the application
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Characteristic that describes the object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
When an application needs to assign data to or retrieve data from a Private variable in a class, it must use a(n) ____ property to do so.

A) Private
B) Public
C) class
D) object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The Set statement begins with the keyword Set and ends with the keywords ____.

A) End Set
B) Return Set
C) Complete Set
D) Exit Set
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used in a Property procedure header to indicate that an application can set the property's value, but it cannot retrieve the value
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
You should use ____ to name a property.

A) nouns and verbs
B) verbs
C) adverbs and adjectives
D) nouns and adjectives
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
Constructors that contain parameters are called ____________________ constructors.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
____ enable you to specify the property of a class in one line of code.

A) System properties
B) Auto-implemented properties
C) Restricted properties
D) Class-delivered properties
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
After you define a class, you can then use the class to instantiate one or more ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
A constructor that has no parameters is called the ____________________ constructor.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Can be used to create a Public property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Includes methods and events
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Match each item with a statement below.
a.Property procedure
f.behavior
b.attribute
g.ReadOnly keyword
c.Set block
h.New keyword
d.Private keyword
i.WriteOnly keyword
e.Get block
Used to create an object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
An application cannot access the ____________________ variables in a class.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
How can you make the Private members of a class available to an application?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
What is meant by overloaded methods and when is overloading of methods useful?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
To allow for salaried employees that are paid on a schedule other than the standard, what is the header for the appropriate method to retrieve their gross salary?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
What is a method's signature?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
For the class Student, how you would create the auto-implemented string property of Firstname?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
What are the steps to add a class file to the current project?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
What are the rules for naming methods?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
Describe a Property procedure header.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
Although you can define a class that contains only attributes represented by Public variables, it is rarely done. Describe the disadvantage of using Public variables in a class.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
What is a constructor? What is the purpose of a constructor?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.