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

A - CBool(expression)

B - CByte(expression)

C - CChar(expression)

D - CDate(expression)

Answer : B

Explanation

CByte(expression) − Converts the expression to Byte 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 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 is not implemented in this class and must be overridden in a derived class before it can be used?

A - MustInherit

B - MustOverride

C - Narrowing

D - NotInheritable

Answer : B

Explanation

MustOverride − Specifies that a property or procedure is not implemented in this class and must be overridden in a derived class before it can be used.

Q 5 - Which of the following accesss modifier specifies that one or more declared programming elements are accessible only from within their declaration context, including from within any contained types?

A - Private

B - Protected

C - Public

D - ReadOnly

Answer : A

Explanation

Private − Specifies that one or more declared programming elements are accessible only from within their declaration context, including from within any contained types.

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 transfers control to the labeled statement?

A - Exit

B - Continue

C - GoTo

D - None of the above.

Answer : C

Explanation

GoTo − Transfers control to the labeled statement. Though it is not advised to use GoTo statement in your program.

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 - Which of the following keyword of VB.NET is used to throw an exception when a problem shows up?

A - Try

B - Catch

C - Finally

D - Throw

Answer : D

Explanation

Throw − A program throws an exception when a problem shows up. This is done using a Throw keyword.


vb.net_questions_answers.htm

Advertisements