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

A - CDbl(expression)

B - CDec(expression)

C - CInt(expression)

D - CLng(expression)

Answer : D

Explanation

CLng(expression) − Converts the expression to Long data type.

Q 3 - Which of the following accesss modifier specifies that an argument is passed in such a way that the called procedure or property cannot change the value of a variable underlying the argument in the calling code?

A - ByRef

B - ByVal

C - Default

D - Friend

Answer : B

Explanation

ByVal − Specifies that an argument is passed in such a way that the called procedure or property cannot change the value of a variable underlying the argument in the calling code.

Q 4 - Which of the following accesss modifier specifies that the type is covariant?

A - NotOverridable

B - Optional

C - Out

D - Overloads

Answer : C

Explanation

Out − For generic type parameters, the Out keyword specifies that the type is covariant.

Q 5 - Which of the following accesss modifier specifies that one or more declared programming elements have no access restrictions?

A - Private

B - Protected

C - Public

D - ReadOnly

Answer : C

Explanation

Public − Specifies that one or more declared programming elements have no access restrictions.

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 the name of an interface and introduces the definitions of the members that the interface comprises?

A - Structure

B - Module

C - Interface

D - Function

Answer : C

Explanation

Interface − Declares the name of an interface and introduces the definitions of the members that the interface comprises.

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 uses a key to access the elements in the collection?

A - ArrayList

B - Hashtable

C - SortedList

D - Stack

Answer : B

Explanation

Hashtable − It uses a key to access the elements in the collection. A Hashtable is used when you need to access elements by using key, and you can identify a useful key value. Each item in the hash table has a key/value pair. The key is used to access the items in the collection.

Q 10 - The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown.

A - true

B - false

Answer : A

Explanation

The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown.


vb.net_questions_answers.htm

Advertisements