NEW
Font size
WorksheetsVB.NET BASIC QUIZ
Total questions: 50
Worksheet time: 25mins
What is the Common Language Runtime (CLR)?
Which of these is not a .NET base class library namespace?
System.Audio
What does IL stand for in .NET?
What compiles source code into IL?
CLR
JIT Compiler
.NET Compiler (csc.exe/vbc.exe)
Which file type is generated after compilation in .NET?
.exe or .dll
.jar
.class
.com
Which tool converts IL to native code at runtime?
What is the role of the Garbage Collector?
Garbage Collector manage memory by reclaiming unused objects.
What does ADO.NET provide?
Which assembly contains basic data types like String and Int32?
mscorlib.dll
What technology is used for Windows desktop applications in .NET?
What is Boxing?
Storing reference types as value types
Converting value types to reference types
Wrapping exceptions
Creating memory containers
What is Unboxing?
Convert reference type to value type
Convert string to integer
Convert class to struct
Convert value type to reference type
Which .NET feature allows language interoperability?
JIT
IL
Garbage Collector
CLI
What is an Anonymous Method?
Method without name
Class without name
Delegate with no parameters
Extension to XML
What is a Delegates in .NET?
Storage container
Object that holds method references
UI widget
Exception type
Which is true of LINQ?
Language for UI creation
Query syntax in .NET
Encryption library
Graphics API
What's the default module entry point in VB.NET?
How do you import a namespace in VB.NET?
using
#include
Imports
Namespace
Which is the correct VB.NET comment syntax?
How do you declare a variable in VB.NET?
Dim x As Integer
var x: Integer
int x
let x As Integer
Which is correct constant declaration?
Const Pi As Double
Constant Pi As Double
let Pi As Double
static Pi As Double
VB.NET string concatenation is done with: …
+
&
.Concat()
*
Which is correct syntax for a function returning Integer?
Function Add() As Integer
Sub Add() As Integer
Dim Add() As Integer
Method Add(): Integer
VB.NET array creation syntax?
Dim arr(5) As Integer
Dim arr[5] As Integer
Dim arr = New Integer(4) {}
Both A and C
What is the syntax of an If statement in VB.NET?
if (condition) {}
If condition Then … End If
If {condition} =>
f condition then {}
What is used for multiple condition checking in VB.NET?
If…Else
Select Case
For Loop
Do While
Which keyword is used to skip to the next iteration of a loop?
Break
Exit
Skip
Continue
Which keyword is used to exit a loop in VB.NET?
Continue
Exit
Stop
End
Which is the correct syntax for a For loop in VB.NET?
for i = 1 to 10
For i = 1 To 10
For (i=1;i<=10;i++)
foreach i in 1..10
What is the default increment in a For loop in VB.NET?
2
0
1
Depends on user input
What does the Step keyword do in a For loop?
Declares variable
Specifies condition
Defines increment/decrement
Terminates loop
Which loop is guaranteed to run at least once?
For
While
Do While
Do…Loop Until
Which of the following is correct?
Select Case x
Case 1
Console.WriteLine("One")
Case Else
Console.WriteLine("Other")
End Select
Valid syntax
Invalid – missing If
Invalid – no Switch keyword
Valid but only for strings
What type must a Select Case variable be?
Only Integer
Any scalar type (Integer, String, etc.)
Only String
Only Boolean
Which loop is ideal when the number of iterations is known?
While
Do While
For
Do Until
For i = 1 To 5 Step 2
Console.Write(i & " ")
Next
1 2 3 4 5
1 3 5
1 2 3
2 4 6
What keyword breaks a `Select Case` block in VB.NET?
End
Stop
Exit Select
Break
Which loop doesn't require an initial counter?
For
While
Do While
B and C
What happens if the condition is always true in a `While` loop?
Compile error
Runtime exception
Infinite loop
Skipped
int[] arr = {1, 2, 3, 4};
int sum = 0;
for (int i = 0; i < arr.Length; i++)
sum += arr[i];
Console.WriteLine(sum);
10
9
6
Compilation Error
Dim numbers() As Integer = {1, 3, 5}
Dim total As Integer = 0
For Each n As Integer In numbers
total += n
Next
Console.WriteLine(total)
9
8
10
6
int i = 0;
while (i < 5)
{
i++;
if (i == 3) continue;
Console.Write(i);
}
12345
1245
1234
1345
Which statement correctly initializes an array of 4 integers in VB.NET?
Dim arr As Integer(4)
Dim arr(3) As Integer
Dim arr As Integer = (1,2,3,4)
Dim arr As Integer() = new Integer(4)
int[] arr = new int[3];
Console.Write(arr[0]);
0
1
null
Compilation Error
Dim i As Integer = 1
Do While i < 4
Console.Write(i)
i += 1
Loop
123
0123
234
345
Dim arr() As Integer = {10, 20, 30}
Console.WriteLine(arr(1))
10
20
30
error
Dim a() As Integer = {1, 2, 3}
Dim i As Integer = 0
While i < a.Length
Console.Write(a(i))
i += 1
End While
123
012
321
0123
int[] arr = {5, 10, 15, 20};
Console.Write(arr.Length);
3
4
5
error
Dim x As Integer = 5
If x > 2 And x < 10 Then
Console.WriteLine("Valid")
End If
Error
Invalid
Valid
5
Dim grade As Char = "B"
Select Case grade
Case "A"
Console.Write("Excellent")
Case "B"
Console.Write("Good")
Case Else
Console.Write("Poor")
End Select
Excellent
Good
Poor
Compilation Error
