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 is a basic data type in VB.NET?

A - Boolean

B - Byte

C - Char

D - All of the above.

Answer : D

Explanation

All of the above are basic data types.

Q 2 - Which of the following converts the expression to String data type in VB.NET?

A - CStr(expression)

B - CSByte(expression)

C - CShort(expression)

D - CSng(expression)

Answer : A

Explanation

CStr(expression) − Converts the expression to String data type.

Q 3 - Which of the following accesss modifier enables you to specify behavior for properties of anonymous types?

A - In

B - Iterator

C - Key

D - Module

Answer : C

Explanation

Key − The Key keyword enables you to specify behavior for properties of anonymous types.

Q 4 - Which of the following accesss modifier specifies that a class can be used only as a base class and that you cannot create an object directly from it?

A - MustInherit

B - MustOverride

C - Narrowing

D - NotInheritable

Answer : A

Explanation

MustInherit − Specifies that a class can be used only as a base class and that you cannot create an object directly from it.

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 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 of a property, and the property procedures used to store and retrieve the value of the property?

A - Sub

B - Declare

C - Operator

D - Property

Answer : D

Explanation

Property − Declares the name of a property, and the property procedures used to store and retrieve the value of the property.

Q 8 - Which of the following operator returns the address of a procedure?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : A

Explanation

AddressOf − Returns the address of a procedure.

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

Explanation

LongLength gets a 64-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