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 2 - Which of the following converts the expression to Single data type in VB.NET?

A - CObj(expression)

B - CSByte(expression)

C - CShort(expression)

D - CSng(expression)

Answer : D

Explanation

CSng(expression) − Converts the expression to Single 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 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 statement declares and allocates storage space for one or more variables?

A - Dim

B - Const

C - Enum

D - Class

Answer : A

Explanation

Dim − Declares and allocates storage space for one or more variables.

Q 7 - Which of the following directive defines conditional compiler constants?

A - #Const

B - #ExternalSource

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

D - #Region

Answer : A

Explanation

#Const − This directive defines conditional compiler constants.

Q 8 - Which of the following operator uses short-circuit evaluation to conditionally return one of two values?

A - If

B - Await

C - GetType

D - Function Expression

Answer : A

Explanation

If − It uses short-circuit evaluation to conditionally return one of two values. The If operator can be called with three arguments or with two arguments.

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.

Answer : C

Explanation

Both of the above options are correct.


vb.net_questions_answers.htm

Advertisements