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 Char data type in VB.NET?

A - CBool(expression)

B - CByte(expression)

C - CChar(expression)

D - CDate(expression)

Answer : C

Explanation

CChar(expression) − Converts the expression to Char data type.

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 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 allows you to pass an arbitrary number of arguments to the procedure?

A - Overridable

B - Overrides

C - ParamArray

D - Partial

Answer : C

Explanation

ParamArray − ParamArray allows you to pass an arbitrary number of arguments to the procedure. A ParamArray parameter is always declared using ByVal.

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 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 Collection class of VB.NET represents a last-in, first out collection of object?

A - ArrayList

B - Hashtable

C - SortedList

D - Stack

Answer : D

Explanation

Stack − It represents a last-in, first out collection of object. It is used when you need a last-in, first-out access of items. When you add an item in the list, it is called pushing the item, and when you remove it, it is called popping the item.

Q 10 - Which of the following Collection class of VB.NET represents an array of the binary representation using the values 1 and 0?

A - Queue

B - BitArray

C - SortedList

D - Stack

Answer : B

Explanation

BitArray − It represents an array of the binary representation using the values 1 and 0. It is used when you need to store the bits but do not know the number of bits in advance. You can access items from the BitArray collection by using an integer index, which starts from zero.

vb.net_questions_answers.htm
Advertisements