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

A - CObj(expression)

B - CSByte(expression)

C - CShort(expression)

D - CSng(expression)

Answer : B

Explanation

CSByte(expression) − Converts the expression to SByte data type.

Q 3 - Which of the following accesss modifier specifies that a function or Get accessor is an iterator?

A - In

B - Iterator

C - Key

D - Module

Answer : B

Explanation

Iterator − Specifies that a function or Get accessor is an iterator. An iterator performs a custom iteration over a collection.

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 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 accesss modifier specifies that Visual Basic should marshal all strings to Unicode values regardless of the name of the external procedure being declared?

A - Shadows

B - Shared

C - Static

D - Unicode

Answer : D

Explanation

Unicode − Specifies that Visual Basic should marshal all strings to Unicode values regardless of the name of the external procedure being declared.

Q 7 - Which of the following statement declares the name, parameters, and code that define a Function procedure?

A - Structure

B - Module

C - Interface

D - Function

Answer : D

Explanation

Function − Declares the name, parameters, and code that define a Function procedure.

Q 8 - Which of the following directive helps in collapsing and hiding sections of code in Visual Basic files?

A - #Const

B - #ExternalSource

C - #If...Then...#Else

D - #Region

Answer : D

Explanation

#Region − This directive helps in collapsing and hiding sections of code in Visual Basic files.

Q 9 - Which of the following Collection class of VB.NET uses a key as well as an index to access the items in a list?

A - ArrayList

B - Hashtable

C - SortedList

D - Stack

Answer : C

Explanation

SortedList − It uses a key as well as an index to access the items in a list. A sorted list is a combination of an array and a hash table. It contains a list of items that can be accessed using a key or an index. If you access items using an index, it is an ArrayList, and if you access items using a key, it is a Hashtable. The collection of items is always sorted by the key value.

Q 10 - Which of the following block of VB.NET identifies a block of code for which particular exceptions will be activated?

A - Try

B - Catch

C - Finally

D - Throw

Answer : A

Explanation

Try − A Try block identifies a block of code for which particular exceptions will be activated. It's followed by one or more Catch blocks.

vb.net_questions_answers.htm
Advertisements