wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

VB.NET BASIC QUIZ

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

What is the Common Language Runtime (CLR)?

a)
The CLR is a programming language used in .NET development.
b)
The Common Language Runtime (CLR) is the virtual machine component of the .NET framework that manages the execution of .NET programs.
c)
The CLR is a web server component of the .NET framework.
d)
The CLR is a database management system for .NET applications.
2.

Which of these is not a .NET base class library namespace?

a)
System.Data
b)
System.Collections
c)
System.IO
d)

System.Audio

3.

What does IL stand for in .NET?

a)
Intermediate Language
b)
Integrated Logic
c)
Internal Language
d)
Interface Layer
4.

What compiles source code into IL?

a)

CLR

b)

JIT Compiler

c)

.NET Compiler (csc.exe/vbc.exe)

d)
Visual Studio IDE
5.

Which file type is generated after compilation in .NET?

a)

.exe or .dll

b)

.jar

c)

.class

d)

.com

6.

Which tool converts IL to native code at runtime?

a)
Just-In-Time (JIT) compiler
b)
Runtime interpreter
c)
Static code analyzer
d)
Ahead-Of-Time (AOT) compiler
7.

What is the role of the Garbage Collector?

a)
The Garbage Collector compiles code for execution.
b)
The Garbage Collector optimizes CPU usage.
c)
The Garbage Collector handles user input and output.
d)

Garbage Collector manage memory by reclaiming unused objects.

8.

What does ADO.NET provide?

a)
ADO.NET provides data access and manipulation capabilities for .NET applications.
b)
ADO.NET is a cloud storage solution for data.
c)
ADO.NET is a web development framework.
d)
ADO.NET is a programming language for mobile apps.
9.

Which assembly contains basic data types like String and Int32?

a)
System.Core
b)
System.Xml
c)
System.Data
d)

mscorlib.dll

10.

What technology is used for Windows desktop applications in .NET?

a)
ASP.NET MVC
b)
Electron Framework
c)
WPF and Windows Forms
d)
JavaFX
11.

What is Boxing?

a)

Storing reference types as value types

b)

Converting value types to reference types

c)

Wrapping exceptions

d)
  • Creating memory containers

12.

What is Unboxing?

a)

Convert reference type to value type

b)

Convert string to integer

c)

Convert class to struct

d)

Convert value type to reference type

13.

Which .NET feature allows language interoperability?

a)

JIT

b)

IL

c)

Garbage Collector

d)

CLI

14.

What is an Anonymous Method?

a)

Method without name

b)

Class without name

c)

Delegate with no parameters

d)

Extension to XML

15.

What is a Delegates in .NET?

a)

Storage container

b)

Object that holds method references

c)

UI widget

d)

Exception type

16.

Which is true of LINQ?

a)

Language for UI creation

b)

Query syntax in .NET

c)

Encryption library

d)

Graphics API

17.

What's the default module entry point in VB.NET?

a)
Start method
b)
Execute method
c)
Run method
d)
Main method
18.

How do you import a namespace in VB.NET?

a)

using

b)

#include

c)

Imports

d)

Namespace

19.

Which is the correct VB.NET comment syntax?

a)
/* This is a comment in VB.NET */
b)
// This is a comment in VB.NET
c)
' This is a comment in VB.NET
d)
# This is a comment in VB.NET
20.

How do you declare a variable in VB.NET?

a)

Dim x As Integer

b)

var x: Integer

c)

int x

d)

let x As Integer

21.

Which is correct constant declaration?

a)

Const Pi As Double

b)

Constant Pi As Double

c)

let Pi As Double

d)

static Pi As Double

22.

VB.NET string concatenation is done with: …

a)

+

b)

&

c)

.Concat()

d)

*

23.

Which is correct syntax for a function returning Integer?

a)

Function Add() As Integer

b)

Sub Add() As Integer

c)

Dim Add() As Integer

d)

Method Add(): Integer

24.

VB.NET array creation syntax?

a)

Dim arr(5) As Integer

b)

Dim arr[5] As Integer

c)

Dim arr = New Integer(4) {}

d)

Both A and C

25.

What is the syntax of an If statement in VB.NET?

a)

if (condition) {}

b)

If condition Then … End If

c)

If {condition} =>

d)

f condition then {}

26.

What is used for multiple condition checking in VB.NET?

a)

If…Else

b)

Select Case

c)

For Loop

d)

Do While

27.

Which keyword is used to skip to the next iteration of a loop?

a)

Break

b)

Exit

c)

Skip

d)

Continue

28.

Which keyword is used to exit a loop in VB.NET?

a)

Continue

b)

Exit

c)

Stop

d)

End

29.

Which is the correct syntax for a For loop in VB.NET?

a)

for i = 1 to 10

b)

For i = 1 To 10

c)

For (i=1;i<=10;i++)

d)

foreach i in 1..10

30.

What is the default increment in a For loop in VB.NET?

a)

2

b)

0

c)

1

d)

Depends on user input

31.

What does the Step keyword do in a For loop?

a)

Declares variable

b)

Specifies condition

c)

Defines increment/decrement

d)

Terminates loop

32.

Which loop is guaranteed to run at least once?

a)

For

b)

While

c)

Do While

d)

Do…Loop Until

33.

Which of the following is correct?

Select Case x

Case 1

Console.WriteLine("One")

Case Else

Console.WriteLine("Other")

End Select

a)

Valid syntax

b)

Invalid – missing If

c)

Invalid – no Switch keyword

d)

Valid but only for strings

34.

What type must a Select Case variable be?

a)

Only Integer

b)

Any scalar type (Integer, String, etc.)

c)

Only String

d)

Only Boolean

35.

Which loop is ideal when the number of iterations is known?

a)

While

b)

Do While

c)

For

d)

Do Until

36.

For i = 1 To 5 Step 2

Console.Write(i & " ")

Next

a)

1 2 3 4 5

b)

1 3 5

c)

1 2 3

d)

2 4 6

37.

What keyword breaks a `Select Case` block in VB.NET?

a)

End

b)

Stop

c)

Exit Select

d)

Break

38.

Which loop doesn't require an initial counter?

a)

For

b)

While

c)

Do While

d)

B and C

39.

What happens if the condition is always true in a `While` loop?

a)

Compile error

b)

Runtime exception

c)

Infinite loop

d)

Skipped

40.

int[] arr = {1, 2, 3, 4};

int sum = 0;

for (int i = 0; i < arr.Length; i++)

sum += arr[i];

Console.WriteLine(sum);

a)

10

b)

9

c)

6

d)

Compilation Error

41.

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)

a)

9

b)

8

c)

10

d)

6

42.

int i = 0;

while (i < 5)

{

i++;

if (i == 3) continue;

Console.Write(i);

}

a)

12345

b)

1245

c)

1234

d)

1345

43.

Which statement correctly initializes an array of 4 integers in VB.NET?

a)

Dim arr As Integer(4)

b)

Dim arr(3) As Integer

c)

Dim arr As Integer = (1,2,3,4)

d)

Dim arr As Integer() = new Integer(4)

44.

int[] arr = new int[3];

Console.Write(arr[0]);

a)

0

b)

1

c)

null

d)

Compilation Error

45.

Dim i As Integer = 1

Do While i < 4

Console.Write(i)

i += 1

Loop

a)

123

b)

0123

c)

234

d)

345

46.

Dim arr() As Integer = {10, 20, 30}

Console.WriteLine(arr(1))

a)

10

b)

20

c)

30

d)

error

47.

Dim a() As Integer = {1, 2, 3}

Dim i As Integer = 0

While i < a.Length

Console.Write(a(i))

i += 1

End While

a)

123

b)

012

c)

321

d)

0123

48.

int[] arr = {5, 10, 15, 20};

Console.Write(arr.Length);

a)

3

b)

4

c)

5

d)

error

49.

Dim x As Integer = 5

If x > 2 And x < 10 Then

Console.WriteLine("Valid")

End If

a)

Error

b)

Invalid

c)

Valid

d)

5

50.

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

a)

Excellent

b)

Good

c)

Poor

d)

Compilation Error