Deck 11: Classes and Objects

Full screen (f)
exit full mode
Question
The code in the Get block allows the application to assign a value to the Private variable.
Use Space or
up arrow
down arrow
to flip the card.
Question
The sole purpose of a constructor is to initialize the class's variables.
Question
Two constructors in a class can have the same parameters.
Question
Constructors must be Function procedures.
Question
Using a Public property to assign a value received from a program ensures that the Set block is processed.
Question
All the words in a method name should be verbs.
Question
When you use a class to create an object in an application, the procedures declared using the Private keyword are hidden from the application.
Question
When you use a class to create an object in an application, variables declared using both the Public keyword and the Private keyword are made available to the application.
Question
The Class statement is entered in a class file.
Question
The methods of an object describe its characteristics.
Question
The Class statement begins with the keywords Private Class.
Question
You can enter only one instruction within a Set statement.
Question
A method that is not a constructor can be either a Sub procedure or a Function procedure.
Question
By convention, the first letter of each word in a method name should be capitalized.
Question
Every class should have at least one constructor.
Question
The methods in a class cannot reference the class's Private variables directly; they must reference the Private variables indirectly through the Public properties.
Question
By convention, most programmers capitalize the first letter in a class name.
Question
A statement that is used to create an object from a class must begin with the Dim keyword.
Question
You should always use a Public property to assign a value received from a program.
Question
The Get block of a Public property typically contains the validation code.
Question
A Property procedure begins with the keywords ____.

A) Public Property
B) Private Property
C) Start Property
D) Dim Property
Question
The default constructor has ____ parameter(s).

A) 0
B) 1
C) 2
D) n
Question
After an object is created and its address assigned to a variable, you can access its properties using the syntax ____.

A) objectVariable ( property )
B) objectVariable . property
C) objectVariable (). property
D) objectVariable [ property ]
Question
The data type of a Property procedure must match the data type of the Private variable associated with the Property procedure.
Question
The Get statement begins with the keywords Start Get.
Question
The code contained in the ____ block allows an application to retrieve the contents of the Private variable associated with the property.

A) Set
B) Assign
C) New
D) Get
Question
A ____ is a method whose instructions the computer processes, automatically, each time an object is created from the class.

A) structure
B) designer
C) loader
D) constructor
Question
By convention, the first letter of each word in a property name should be capitalized.
Question
Within the Property procedure you define a Get block of code and a(n) ____ block of code.

A) Retrieve
B) Set
C) New
D) Assign
Question
The properties of an object allow the object to perform tasks.
Question
You create a Public property using a Property ____.

A) variable
B) procedure
C) constructor
D) class
Question
When an application needs to assign data to or retrieve data from a Private variable in a class, it must use a Public ____ to do so.

A) parameter
B) constructor
C) argument
D) property
Question
When a property is declared using the ____ keyword, it can be accessed by any application that uses an object created from the class.

A) Public
B) Private
C) Protected
D) Friend
Question
Each constructor included in a class has the name ____.

A) Get
B) Set
C) New
D) Start
Question
A variable that is declared with the ____ keyword can be used only by the class in which it is defined.

A) Public
B) Protected
C) Friend
D) Private
Question
Objects are created, or instantiated, from ____.

A) methods
B) properties
C) variables
D) classes
Question
You can define a class that contains properties only.
Question
The Class statement ends with the keyword(s) ____.

A) Class
B) Exit Class
C) End Class
D) Next Class
Question
A Property procedure ends with the keyword(s) ____.

A) Property
B) Exit Property
C) End Property
D) Next Property
Question
The Set statement begins with the keyword ____.

A) Set
B) Public Set
C) Start Set
D) Private Set
Question
A ____ encapsulates the attributes and behaviors of the object it creates.

A) constructor
B) property
C) class
D) structure
Question
The Return privateVariable instruction is entered in ____.

A) the default constructor
B) a constructor other than the default constructor
C) a Get block
D) a Set block
Question
The first word in a method name should be a(n) ____.

A) verb
B) noun
C) adjective
D) preposition
Question
The Get statement ends with the keyword(s) ____.

A) Get
B) End Get
C) Exit Get
D) Next Get
Question
You should use ____ to name a property.

A) nouns only
B) adjectives only
C) verbs only
D) nouns and adjectives
Question
In the following instruction, Room is a(n) ____. Dim bedroom As New Room

A) object
B) variable
C) class
D) property
Question
A text box is created from the TextBox ____.

A) object
B) class
C) method
D) property
Question
A ____ initializes the class's variables.

A) constructor
B) Public property
C) Set block
D) Get block
Question
The ____ privateVariable instruction directs the computer to return the contents of the Private variable.

A) Send
B) Throw
C) Pass
D) Return
Question
In the Set statement, a parameter is enclosed in ____.

A) brackets
B) quotation marks
C) braces
D) parentheses
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 11: Classes and Objects
1
The code in the Get block allows the application to assign a value to the Private variable.
False
2
The sole purpose of a constructor is to initialize the class's variables.
True
3
Two constructors in a class can have the same parameters.
False
4
Constructors must be Function procedures.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Using a Public property to assign a value received from a program ensures that the Set block is processed.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
All the words in a method name should be verbs.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
When you use a class to create an object in an application, the procedures declared using the Private keyword are hidden from the application.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
When you use a class to create an object in an application, variables declared using both the Public keyword and the Private keyword are made available to the application.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The Class statement is entered in a class file.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
The methods of an object describe its characteristics.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The Class statement begins with the keywords Private Class.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
You can enter only one instruction within a Set statement.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
A method that is not a constructor can be either a Sub procedure or a Function procedure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
By convention, the first letter of each word in a method name should be capitalized.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
Every class should have at least one constructor.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The methods in a class cannot reference the class's Private variables directly; they must reference the Private variables indirectly through the Public properties.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
By convention, most programmers capitalize the first letter in a class name.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A statement that is used to create an object from a class must begin with the Dim keyword.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
You should always use a Public property to assign a value received from a program.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
The Get block of a Public property typically contains the validation code.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
A Property procedure begins with the keywords ____.

A) Public Property
B) Private Property
C) Start Property
D) Dim Property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
The default constructor has ____ parameter(s).

A) 0
B) 1
C) 2
D) n
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
After an object is created and its address assigned to a variable, you can access its properties using the syntax ____.

A) objectVariable ( property )
B) objectVariable . property
C) objectVariable (). property
D) objectVariable [ property ]
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The data type of a Property procedure must match the data type of the Private variable associated with the Property procedure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The Get statement begins with the keywords Start Get.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The code contained in the ____ block allows an application to retrieve the contents of the Private variable associated with the property.

A) Set
B) Assign
C) New
D) Get
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A ____ is a method whose instructions the computer processes, automatically, each time an object is created from the class.

A) structure
B) designer
C) loader
D) constructor
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
By convention, the first letter of each word in a property name should be capitalized.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
Within the Property procedure you define a Get block of code and a(n) ____ block of code.

A) Retrieve
B) Set
C) New
D) Assign
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The properties of an object allow the object to perform tasks.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
You create a Public property using a Property ____.

A) variable
B) procedure
C) constructor
D) class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
When an application needs to assign data to or retrieve data from a Private variable in a class, it must use a Public ____ to do so.

A) parameter
B) constructor
C) argument
D) property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
When a property is declared using the ____ keyword, it can be accessed by any application that uses an object created from the class.

A) Public
B) Private
C) Protected
D) Friend
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Each constructor included in a class has the name ____.

A) Get
B) Set
C) New
D) Start
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
A variable that is declared with the ____ keyword can be used only by the class in which it is defined.

A) Public
B) Protected
C) Friend
D) Private
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Objects are created, or instantiated, from ____.

A) methods
B) properties
C) variables
D) classes
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
You can define a class that contains properties only.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
The Class statement ends with the keyword(s) ____.

A) Class
B) Exit Class
C) End Class
D) Next Class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
A Property procedure ends with the keyword(s) ____.

A) Property
B) Exit Property
C) End Property
D) Next Property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The Set statement begins with the keyword ____.

A) Set
B) Public Set
C) Start Set
D) Private Set
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
A ____ encapsulates the attributes and behaviors of the object it creates.

A) constructor
B) property
C) class
D) structure
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
The Return privateVariable instruction is entered in ____.

A) the default constructor
B) a constructor other than the default constructor
C) a Get block
D) a Set block
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The first word in a method name should be a(n) ____.

A) verb
B) noun
C) adjective
D) preposition
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
The Get statement ends with the keyword(s) ____.

A) Get
B) End Get
C) Exit Get
D) Next Get
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
You should use ____ to name a property.

A) nouns only
B) adjectives only
C) verbs only
D) nouns and adjectives
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
In the following instruction, Room is a(n) ____. Dim bedroom As New Room

A) object
B) variable
C) class
D) property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
A text box is created from the TextBox ____.

A) object
B) class
C) method
D) property
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
A ____ initializes the class's variables.

A) constructor
B) Public property
C) Set block
D) Get block
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
The ____ privateVariable instruction directs the computer to return the contents of the Private variable.

A) Send
B) Throw
C) Pass
D) Return
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
In the Set statement, a parameter is enclosed in ____.

A) brackets
B) quotation marks
C) braces
D) parentheses
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.