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

A - CObj(expression)

B - CSByte(expression)

C - CShort(expression)

D - CSng(expression)

Answer : C

Explanation

CShort(expression) − Converts the expression to Short data type.

Q 3 - Which of the following accesss modifier identifies a property as the default property of its class, structure, or interface?

A - ByRef

B - ByVal

C - Default

D - Friend

Answer : C

Explanation

Default − Identifies a property as the default property of its class, structure, or interface.

Q 4 - Which of the following accesss modifier indicates that a conversion operator (CType) converts a class or structure to a type that might not be able to hold some of the possible values of the original class or structure?

A - MustInherit

B - MustOverride

C - Narrowing

D - NotInheritable

Answer : C

Explanation

Narrowing − Indicates that a conversion operator (CType) converts a class or structure to a type that might not be able to hold some of the possible values of the original class or structure.

Q 5 - Which of the following accesss modifier indicates that a class or structure declaration is a partial definition of the class or structure?

A - Overridable

B - Overrides

C - ParamArray

D - Partial

Answer : D

Explanation

Partial − Indicates that a class or structure declaration is a partial definition of the class or structure.

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 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 8 - 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.

Q 9 - Which of the following Collection class of VB.NET represents a first-in, first out collection of object?

A - Queue

B - BitArray

C - SortedList

D - Stack

Answer : A

Explanation

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

Answer : C

Explanation

Both of the above options are correct.

vb.net_questions_answers.htm
Advertisements