VB.Net Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to VB.Net. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : D

Explanation

All of the above options are correct.

Q 2 - Which of the following converts the expression to Long data type in VB.NET?

A - CDbl(expression)

B - CDec(expression)

C - CInt(expression)

D - CLng(expression)

Answer : D

Explanation

CLng(expression) − Converts the expression to Long data type.

Q 3 - Which of the following accesss modifier specifies that an argument is passed by reference?

A - ByRef

B - ByVal

C - Default

D - Friend

Answer : A

Explanation

ByRef − Specifies that an argument is passed by reference, i.e., the called procedure can change the value of a variable underlying the argument in the calling code.

Q 4 - Which of the following accesss modifier specifies that a class cannot be used as a base class?

A - MustInherit

B - MustOverride

C - Narrowing

D - NotInheritable

Answer : D

Explanation

NotInheritable − Specifies that a class cannot be used as a base class.

Q 5 - Which of the following accesss modifier specifies that one or more declared programming elements are accessible only from within their declaration context, including from within any contained types?

A - Private

B - Protected

C - Public

D - ReadOnly

Answer : A

Explanation

Private − Specifies that one or more declared programming elements are accessible only from within their declaration context, including from within any contained types.

Q 6 - 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 7 - 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 8 - 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 9 - Which of the following Collection class of VB.NET represents ordered collection of an object that can be indexed individually?

A - ArrayList

B - Hashtable

C - SortedList

D - Stack

Answer : A

Explanation

ArrayList − It represents ordered collection of an object that can be indexed individually. It is basically an alternative to an array. However, unlike array, you can add and remove items from a list at a specified position using an index and the array resizes itself automatically. It also allows dynamic memory allocation, add, search and sort items in the list.

Q 10 - User-defined exception classes are derived from the ApplicationException class in VB.NET?

A - true

B - false

Answer : A

Explanation

User-defined exception classes are derived from the ApplicationException class.

vb.net_questions_answers.htm
Advertisements