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 3 - Which of the following accesss modifier specifies that Visual Basic should marshal strings according to .NET Framework rules?

A - Ansi

B - Assembly

C - Async

D - Auto

Answer : D

Explanation

Auto − The charset modifier part in the Declare statement supplies the character set information for marshaling strings during a call to the external procedure. It also affects how Visual Basic searches the external file for the external procedure name. The Auto modifier specifies that Visual Basic should marshal strings according to .NET Framework rules.

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 a variable or property can be read but not written?

A - Private

B - Protected

C - Public

D - ReadOnly

Answer : D

Explanation

ReadOnly − Specifies that a variable or property can be read but not written.

Q 6 - Which of the following statement declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises?

A - Structure

B - Module

C - Interface

D - Function

Answer : A

Explanation

Structure − Declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises.

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 statement causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating?

A - Exit

B - Continue

C - GoTo

D - None of the above.

Answer : B

Explanation

Continue − Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.

Q 9 - Which of the following property of Array class in VB.NET checks whether the Array is readonly?

A - IsFixedSize

B - IsReadOnly

C - Length

D - None of the above.

Answer : B

Explanation

IsReadOnly gets a value indicating whether the Array is readonly.

Answer : C

Explanation

Both of the above options are correct.

vb.net_questions_answers.htm
Advertisements