VB.Net Mock Test



This section presents you various set of Mock Tests related to VB.Net. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

VB.Net Mock Test IV

Q 1 - Which of the following operator declares the parameters and code that define a function lambda expression?

A - AddressOf

B - Await

C - GetType

D - Function Expression

Answer : D

Explanation

Function Expression − It declares the parameters and code that define a function lambda expression.

Q 2 - 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 3 - 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 4 - Which of the following statement causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating?

A - Exit

B - Continue

C - GoTo

D - None of the above.

Answer : B

Explanation

Continue − Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.

Q 5 - 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 6 - Which of the following property of Array class in VB.NET checks whether the Array has a fixed size?

A - IsFixedSize

B - IsStatic

C - Length

D - None of the above.

Answer : A

Explanation

IsFixedSize gets a value indicating whether the Array has a fixed size.

Q 7 - Which of the following property of Array class in VB.NET checks whether the Array is readonly?

A - IsFixedSize

B - IsReadOnly

C - Length

D - None of the above.

Answer : B

Explanation

IsReadOnly gets a value indicating whether the Array is readonly.

Q 8 - Which of the following property of Array class in VB.NET gets a 32-bit integer, the total number of elements in all the dimensions of the Array?

A - Rank

B - LongLength

C - Length

D - None of the above.

Answer : C

Explanation

Length gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.

Q 9 - Which of the following property of Array class in VB.NET gets a 64-bit integer, the total number of elements in all the dimensions of the Array?

A - Rank

B - LongLength

C - Length

D - None of the above.

Answer : B

Explanation

LongLength gets a 64-bit integer that represents the total number of elements in all the dimensions of the Array.

Q 10 - Which of the following property of Array class in VB.NET gets the rank (number of dimensions) of the Array?

A - Rank

B - LongLength

C - Length

D - None of the above.

Answer : A

Explanation

Rank gets the rank (number of dimensions) of the Array.

Q 11 - 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 12 - 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 13 - 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 14 - 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.

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

A - Queue

B - BitArray

C - SortedList

D - Stack

Answer : A

Explanation

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

Q 16 - Which of the following Collection class of VB.NET represents an array of the binary representation using the values 1 and 0?

A - Queue

B - BitArray

C - SortedList

D - Stack

Answer : B

Explanation

BitArray − It represents an array of the binary representation using the values 1 and 0. It is used when you need to store the bits but do not know the number of bits in advance. You can access items from the BitArray collection by using an integer index, which starts from zero.

Q 17 - Which of the following block of VB.NET identifies a block of code for which particular exceptions will be activated?

A - Try

B - Catch

C - Finally

D - Throw

Answer : A

Explanation

Try − A Try block identifies a block of code for which particular exceptions will be activated. It's followed by one or more Catch blocks.

Q 18 - Which of the following block of VB.NET identifies a place to catch an exception with an exception handler at the place in a program where you want to handle the problem?

A - Try

B - Catch

C - Finally

D - Throw

Answer : B

Explanation

Catch − A program catches an exception with an exception handler at the place in a program where you want to handle the problem. The Catch keyword indicates the catching of an exception.

Q 19 - 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.

Q 20 - 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.

Q 21 - 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.

Answer : C

Explanation

Both of the above options are correct.

Answer : C

Explanation

Both of the above options are correct.

Q 24 - The System.SystemException class is the base class for all predefined system exception in VB.NET?

A - true

B - false

Answer : A

Explanation

The System.SystemException class is the base class for all predefined system exception.

Q 25 - User-defined exception classes are derived from the ApplicationException class in VB.NET?

A - true

B - false

Answer : A

Explanation

User-defined exception classes are derived from the ApplicationException class.

Answer Sheet

Question Number Answer Key
1 D
2 A
3 A
4 B
5 C
6 A
7 B
8 C
9 B
10 A
11 A
12 B
13 C
14 D
15 A
16 B
17 A
18 B
19 C
20 D
21 A
22 C
23 C
24 A
25 A
vb.net_questions_answers.htm
Advertisements