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 indicates that the method or lambda expression that it modifies is asynchronous?

A - Ansi

B - Assembly

C - Async

D - Auto

Answer : C

Explanation

Async − Indicates that the method or lambda expression that it modifies is asynchronous. Such methods are referred to as async methods. The caller of an async method can resume its work without waiting for the async method to finish.

Q 4 - Which of the following accesss modifier specifies that an attribute at the beginning of a source file applies to the current assembly module?

A - In

B - Iterator

C - Key

D - Module

Answer : D

Explanation

Module − Specifies that an attribute at the beginning of a source file applies to the current assembly module. It is not same as the Module statement.

Q 5 - Which of the following accesss modifier specifies that one or more declared programming elements are accessible only from within their own class or from a derived class?

A - Private

B - Protected

C - Public

D - ReadOnly

Answer : B

Explanation

Protected − Specifies that one or more declared programming elements are accessible only from within their own class or from a derived class.

Q 6 - Which of the following accesss modifier indicates that a conversion operator (CType) converts a class or structure to a type that can hold all possible values of the original class or structure?

A - Widening

B - WithEvents

C - WriteOnly

D - ReadOnly

Answer : A

Explanation

Widening − Indicates that a conversion operator (CType) converts a class or structure to a type that can hold all possible values of the original class or structure.

Q 7 - Which of the following statement declares a user-defined event?

A - Event

B - Delegate

C - Operator

D - Property

Answer : A

Explanation

Event − Declares a user-defined event.

Q 8 - Which of the following operator returns a Type object for the specified type?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : C

Explanation

GetType − It returns a Type object for the specified type. The Type object provides information about the type such as its properties, methods, and events.

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 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