- VB.Net Basic Tutorial
- VB.Net - Home
- VB.Net - Overview
- VB.Net - Environment Setup
- VB.Net - Program Structure
- VB.Net - Basic Syntax
- VB.Net - Data Types
- VB.Net - Variables
- VB.Net - Constants
- VB.Net - Modifiers
- VB.Net - Statements
- VB.Net - Directives
- VB.Net - Operators
- VB.Net - Decision Making
- VB.Net - Loops
- VB.Net - Strings
- VB.Net - Date & Time
- VB.Net - Arrays
- VB.Net - Collections
- VB.Net - Functions
- VB.Net - Subs
- VB.Net - Classes & Objects
- VB.Net - Exception Handling
- VB.Net - File Handling
- VB.Net - Basic Controls
- VB.Net - Dialog Boxes
- VB.Net - Advanced Forms
- VB.Net - Event Handling
- VB.Net Advanced Tutorial
- VB.Net - Regular Expressions
- VB.Net - Database Access
- VB.Net - Excel Sheet
- VB.Net - Send Email
- VB.Net - XML Processing
- VB.Net - Web Programming
- VB.Net Useful Resources
- VB.Net - Quick Guide
- VB.Net - Useful Resources
- VB.Net - Discussion
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.
VB.Net Mock Test IV
Q 1 - Which of the following operator declares the parameters and code that define a function lambda 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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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?
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.
Answer : A
Explanation
The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown.
Q 22 - Which of the following is true about exceptions in VB.NET?
Answer : C
Explanation
Both of the above options are correct.
Q 23 - Which of the following is true about System.ApplicationException class in VB.NET?
A - The System.ApplicationException class supports exceptions generated by application programs.
B - Exceptions defined by the programmers should derive from this class.
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?
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?
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 |