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

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

A - CDbl(expression)

B - CDec(expression)

C - CInt(expression)

D - CLng(expression)

Answer : A

Explanation

CDbl(expression) − Converts the expression to Double data type.

Q 2 - Which of the following accesss modifier specifies that Visual Basic should marshal all strings to American National Standards Institute (ANSI) values regardless of the name of the external procedure being declared in VB.NET?

A - Ansi

B - Assembly

C - Async

D - Auto

Answer : A

Explanation

Ansi − Specifies that Visual Basic should marshal all strings to American National Standards Institute (ANSI) values regardless of the name of the external procedure being declared.

Q 3 - Which of the following accesss modifier specifies that one or more declared programming elements are accessible from within the assembly that contains their declaration, not only by the component that declares them?

A - ByRef

B - ByVal

C - Default

D - Friend

Answer : D

Explanation

Friend − Specifies that one or more declared programming elements are accessible from within the assembly that contains their declaration, not only by the component that declares them.

Q 4 - Which of the following accesss modifier specifies that a property or procedure redeclares one or more existing properties or procedures with the same name?

A - NotOverridable

B - Optional

C - Out

D - Overloads

Answer : D

Explanation

Overloads − Specifies that a property or procedure redeclares one or more existing properties or procedures with the same name.

Q 5 - Which of the following accesss modifier specifies that one or more declared programming elements have no access restrictions?

A - Private

B - Protected

C - Public

D - ReadOnly

Answer : C

Explanation

Public − Specifies that one or more declared programming elements have no access restrictions.

Q 6 - 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 7 - 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 8 - 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 9 - Which of the following property of Array class in VB.NET gets a 64-bit integer, the total number of elements in all the dimensions of the Array?

A - Rank

B - LongLength

C - Length

D - None of the above.

Answer : B

Explanation

LongLength gets a 64-bit integer that represents the total number of elements in all the dimensions of the Array.

Q 10 - Which of the following keyword of VB.NET is used to throw an exception when a problem shows up?

A - Try

B - Catch

C - Finally

D - Throw

Answer : D

Explanation

Throw − A program throws an exception when a problem shows up. This is done using a Throw keyword.

vb.net_questions_answers.htm
Advertisements