VB.Net Mock Test



This section presents you various set of Mock Tests related to VB.Net. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

VB.Net Mock Test III

Q 1 - Which of the following accesss modifier specifies that Visual Basic should marshal all strings to Unicode values regardless of the name of the external procedure being declared?

A - Shadows

B - Shared

C - Static

D - Unicode

Answer : D

Explanation

Unicode − Specifies that Visual Basic should marshal all strings to Unicode values regardless of the name of the external procedure being declared.

Q 2 - Which of the following accesss modifier indicates that a conversion operator (CType) converts a class or structure to a type that can hold all possible values of the original class or structure?

A - Widening

B - WithEvents

C - WriteOnly

D - ReadOnly

Answer : A

Explanation

Widening − Indicates that a conversion operator (CType) converts a class or structure to a type that can hold all possible values of the original class or structure.

Q 3 - Which of the following accesss modifier specifies that one or more declared member variables refer to an instance of a class that can raise events?

A - Widening

B - WithEvents

C - WriteOnly

D - ReadOnly

Answer : B

Explanation

WithEvents − Specifies that one or more declared member variables refer to an instance of a class that can raise events.

Q 4 - Which of the following accesss modifier specifies that a property can be written but not read?

A - Widening

B - WithEvents

C - WriteOnly

D - ReadOnly

Answer : C

Explanation

WriteOnly − Specifies that a property can be written but not read.

Q 5 - Which of the following statement declares and allocates storage space for one or more variables?

A - Dim

B - Const

C - Enum

D - Class

Answer : A

Explanation

Dim − Declares and allocates storage space for one or more variables.

Q 6 - Which of the following statement declares and defines one or more constants?

A - Dim

B - Const

C - Enum

D - Class

Answer : B

Explanation

Const − Declares and defines one or more constants.

Q 7 - Which of the following statement declares an enumeration and defines the values of its members?

A - Dim

B - Const

C - Enum

D - Class

Answer : C

Explanation

Enum − Declares an enumeration and defines the values of its members.

Q 8 - Which of the following statement declares the name of a class and introduces the definition of the variables, properties, events, and procedures that the class comprises?

A - Dim

B - Const

C - Enum

D - Class

Answer : D

Explanation

Class − Declares the name of a class and introduces the definition of the variables, properties, events, and procedures that the class comprises.

Q 9 - Which of the following statement declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises?

A - Structure

B - Module

C - Interface

D - Function

Answer : A

Explanation

Structure − Declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises.

Q 10 - Which of the following statement declares the name of a module and introduces the definition of the variables, properties, events, and procedures that the module comprises?

A - Structure

B - Module

C - Interface

D - Function

Answer : B

Explanation

Module − Declares the name of a module and introduces the definition of the variables, properties, events, and procedures that the module comprises.

Q 11 - Which of the following statement declares the name of an interface and introduces the definitions of the members that the interface comprises?

A - Structure

B - Module

C - Interface

D - Function

Answer : C

Explanation

Interface − Declares the name of an interface and introduces the definitions of the members that the interface comprises.

Q 12 - Which of the following statement declares the name, parameters, and code that define a Function procedure?

A - Structure

B - Module

C - Interface

D - Function

Answer : D

Explanation

Function − Declares the name, parameters, and code that define a Function procedure.

Q 13 - Which of the following statement declares the name, parameters, and code that define a Sub procedure?

A - Sub

B - Declare

C - Operator

D - Property

Answer : A

Explanation

Sub − Declares the name, parameters, and code that define a Sub procedure.

Q 14 - Which of the following statement declares a reference to a procedure implemented in an external file?

A - Sub

B - Declare

C - Operator

D - Property

Answer : B

Explanation

Declare − Declares a reference to a procedure implemented in an external file.

Q 15 - Which of the following statement declares the operator symbol, operands, and code that define an operator procedure on a class or structure?

A - Sub

B - Declare

C - Operator

D - Property

Answer : C

Explanation

Operator − Declares the operator symbol, operands, and code that define an operator procedure on a class or structure.

Q 16 - Which of the following statement declares the name of a property, and the property procedures used to store and retrieve the value of the property?

A - Sub

B - Declare

C - Operator

D - Property

Answer : D

Explanation

Property − Declares the name of a property, and the property procedures used to store and retrieve the value of the property.

Q 17 - Which of the following statement declares a user-defined event?

A - Event

B - Delegate

C - Operator

D - Property

Answer : A

Explanation

Event − Declares a user-defined event.

Q 18 - Which of the following statement is used to declare a delegate?

A - Event

B - Delegate

C - Operator

D - Property

Answer : B

Explanation

Delegate − Used to declare a delegate.

Q 19 - Which of the following directive defines conditional compiler constants?

A - #Const

B - #ExternalSource

C - #If...Then...#Else

D - #Region

Answer : A

Explanation

#Const − This directive defines conditional compiler constants.

Q 20 - Which of the following directive is used for indicating a mapping between specific lines of source code and text external to the source?

A - #Const

B - #ExternalSource

C - #If...Then...#Else

D - #Region

Answer : B

Explanation

#ExternalSource − This directive is used for indicating a mapping between specific lines of source code and text external to the source. It is used only by the compiler and the debugger has no effect on code compilation. This directive allows including external code from an external code file into a source code file.

Q 21 - Which of the following directive conditionally compiles selected blocks of Visual Basic code?

A - #Const

B - #ExternalSource

C - #If...Then...#Else

D - #Region

Answer : C

Explanation

#If...Then...#Else − This directive conditionally compiles selected blocks of Visual Basic code.

Q 22 - Which of the following directive helps in collapsing and hiding sections of code in Visual Basic files?

A - #Const

B - #ExternalSource

C - #If...Then...#Else

D - #Region

Answer : D

Explanation

#Region − This directive helps in collapsing and hiding sections of code in Visual Basic files.

Q 23 - Which of the following operator returns the address of a procedure?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : A

Explanation

AddressOf − Returns the address of a procedure.

Q 24 - Which of the following operator is applied to an operand in an asynchronous method or lambda expression to suspend execution of the method until the awaited task completes?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : B

Explanation

Await − It is applied to an operand in an asynchronous method or lambda expression to suspend execution of the method until the awaited task completes.

Q 25 - Which of the following operator returns a Type object for the specified type?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : C

Explanation

GetType − It returns a Type object for the specified type. The Type object provides information about the type such as its properties, methods, and events.

Answer Sheet

Question Number Answer Key
1 D
2 A
3 B
4 C
5 A
6 B
7 C
8 D
9 A
10 B
11 C
12 D
13 A
14 B
15 C
16 D
17 A
18 B
19 A
20 B
21 C
22 D
23 A
24 B
25 C
vb.net_questions_answers.htm
Advertisements