Font size
WorksheetsC# and .NET Fundamentals Assessment
Total questions: 15
Worksheet time: 8mins
What is the default value of an int in C#?
null
1
-1
0
Which of the following is a value type in C#?
bool
float
string
int
What keyword is used to create a loop that executes at least once?
repeat
do
for
while
What is the purpose of the 'break' statement in a loop?
To exit a loop prematurely.
To continue the loop indefinitely.
To skip the current iteration of the loop.
To pause the loop temporarily.
Which of the following is NOT a control structure in C#?
if statement
for loop
while loop
variable
What is encapsulation in Object-Oriented Programming?
Encapsulation is the process of creating multiple instances of a class.
Encapsulation is the method of exposing all data members of a class to the outside world.
Encapsulation is the bundling of data and methods that operate on that data, restricting direct access to some of the object's components.
Encapsulation refers to the inheritance of properties from a parent class.
Which keyword is used to inherit a class in C#?
inherits
subclass
extends
implements
What is the main purpose of the .NET Framework?
The main purpose of the .NET Framework is to provide a platform for building and running applications on Windows.
To create mobile applications exclusively.
To serve as a database management system.
To provide a platform for building web applications only.
What does CLR stand for in the context of .NET?
Common Language Registry
Common Language Runtime
Common Language Resource
Common Logic Runtime
Which of the following is a valid way to declare a string in C#?
string myString = 'Hello, World!';
string myString = "Hello, World!";
string myString = Hello, World!;
string myString = "Hello, World!";
What is the primary function of ASP.NET?
To build dynamic web applications and services.
To design mobile applications.
To create static HTML pages.
To manage database transactions.
Which method is called when an ASP.NET page is loaded?
Page_Load
Page_Unload
Page_Render
Page_Init
What is the difference between a class and an interface in C#?
A class can contain implementation and state, while an interface only defines a contract without implementation.
An interface can contain fields, while a class cannot.
A class cannot have methods, while an interface can.
A class is abstract, while an interface is concrete.
What is the purpose of the 'using' statement in C#?
To manage resource cleanup for IDisposable objects automatically.
To define a variable scope for a block of code.
To create a new thread for parallel execution.
To handle exceptions in a try-catch block.
What is the role of the Global.asax file in an ASP.NET application?
The Global.asax file handles user authentication.
The Global.asax file manages application-level events and settings in an ASP.NET application.
The Global.asax file is used for database connections.
The Global.asax file stores user session data.
