VB.Net Online Quiz


Advertisements


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

A - CObj(expression)

B - CSByte(expression)

C - CShort(expression)

D - CSng(expression)

Answer : A

Explanation

CObj(expression) − Converts the expression to Object data type.

Q 3 - Which of the following accesss modifier specifies that an argument is passed in such a way that the called procedure or property cannot change the value of a variable underlying the argument in the calling code?

A - ByRef

B - ByVal

C - Default

D - Friend

Answer : B

Explanation

ByVal − Specifies that an argument is passed in such a way that the called procedure or property cannot change the value of a variable underlying the argument in the calling code.

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 specifies that one or more declared local variables are to continue to exist and retain their latest values after termination of the procedure in which they are declared?

A - Shadows

B - Shared

C - Static

D - Unicode

Answer : C

Explanation

Static − Specifies that one or more declared local variables are to continue to exist and retain their latest values after termination of the procedure in which they are declared.

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 directive is used for indicating a mapping between specific lines of source code and text external to the source?

A - #Const

B - #ExternalSource

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

D - #Region

Answer : B

Explanation

#ExternalSource − This directive is used for indicating a mapping between specific lines of source code and text external to the source. It is used only by the compiler and the debugger has no effect on code compilation. This directive allows including external code from an external code file into a source code file.

Q 8 - Which of the following operator declares the parameters and code that define a function lambda expression?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : D

Explanation

Function Expression − It declares the parameters and code that define a function lambda expression.

Q 9 - Which of the following Collection class of VB.NET represents ordered collection of an object that can be indexed individually?

A - ArrayList

B - Hashtable

C - SortedList

D - Stack

Answer : A

Explanation

ArrayList − It represents ordered collection of an object that can be indexed individually. It is basically an alternative to an array. However, unlike array, you can add and remove items from a list at a specified position using an index and the array resizes itself automatically. It also allows dynamic memory allocation, add, search and sort items in the list.

Q 10 - The System.SystemException class is the base class for all predefined system exception in VB.NET?

A - true

B - false

Answer : A

Explanation

The System.SystemException class is the base class for all predefined system exception.


vb.net_questions_answers.htm

Advertisements