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 2 - Which of the following converts the expression to Integer data type in VB.NET?

A - CDbl(expression)

B - CDec(expression)

C - CInt(expression)

D - CLng(expression)

Answer : C

Explanation

CInt(expression) − Converts the expression to Integer 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 the type is covariant?

A - NotOverridable

B - Optional

C - Out

D - Overloads

Answer : C

Explanation

Out − For generic type parameters, the Out keyword specifies that the type is covariant.

Q 5 - Which of the following accesss modifier specifies that one or more declared programming elements are associated with a class or structure at large, and not with a specific instance of the class or structure?

A - Shadows

B - Shared

C - Static

D - Unicode

Answer : B

Explanation

Shared − Specifies that one or more declared programming elements are associated with a class or structure at large, and not with a specific instance of the class or structure.

Q 6 - 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 7 - 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 8 - Which of the following operator uses short-circuit evaluation to conditionally return one of two values?

A - If

B - Await

C - GetType

D - Function Expression

Answer : A

Explanation

If − It uses short-circuit evaluation to conditionally return one of two values. The If operator can be called with three arguments or with two arguments.

Q 9 - Which of the following property of Array class in VB.NET gets a 32-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 : C

Explanation

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

Q 10 - Which of the following block of VB.NET is used to execute a given set of statements, whether an exception is thrown or not thrown?

A - Try

B - Catch

C - Finally

D - Throw

Answer : C

Explanation

Finally − The Finally block is used to execute a given set of statements, whether an exception is thrown or not thrown. For example, if you open a file, it must be closed whether an exception is raised or not.

vb.net_questions_answers.htm
Advertisements