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 accesss modifier specifies that an attribute at the beginning of a source file applies to the entire assembly?

A - Ansi

B - Assembly

C - Async

D - Auto

Answer : B

Explanation

Assembly − Specifies that an attribute at the beginning of a source file applies to the entire assembly.

Q 3 - Which of the following accesss modifier specifies that an argument is passed by reference?

A - ByRef

B - ByVal

C - Default

D - Friend

Answer : A

Explanation

ByRef − Specifies that an argument is passed by reference, i.e., the called procedure can change the value of a variable underlying the argument in the calling code.

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 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 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 is used for indicating a mapping between specific lines of source code and text external to the source?

A - #Const

B - #ExternalSource

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

D - #Region

Answer : B

Explanation

#ExternalSource − This directive is used for indicating a mapping between specific lines of source code and text external to the source. It is used only by the compiler and the debugger has no effect on code compilation. This directive allows including external code from an external code file into a source code file.

Q 8 - Which of the following statement terminates the loop or select case statement and transfers execution to the statement immediately following the loop or select case?

A - Exit

B - Continue

C - GoTo

D - None of the above.

Answer : A

Explanation

Exit − Terminates the loop or select case statement and transfers execution to the statement immediately following the loop or select case.

Q 9 - Which of the following Collection class of VB.NET represents a last-in, first out collection of object?

A - ArrayList

B - Hashtable

C - SortedList

D - Stack

Answer : D

Explanation

Stack − It represents a last-in, first out collection of object. It is used when you need a last-in, first-out access of items. When you add an item in the list, it is called pushing the item, and when you remove it, it is called popping the item.

Answer : C

Explanation

Both of the above options are correct.


vb.net_questions_answers.htm

Advertisements