C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
C# Fundamentals - Lesson 11: Pattern Matching & Nullables Quiz
Answer all questions to test your understanding
1
How do you declare a nullable int in C#?
int? myInt
int myInt?
nullable int myInt
int myInt = null
2
What does the ?? operator do?
Checks if a value is null
Returns the left operand if not null, otherwise the right operand
Checks for equality
Throws an exception if null
3
What does the 'is' keyword do in pattern matching?
Checks type compatibility
Casts an object
Creates a new object
Deletes an object
4
What is pattern matching in C#?
A way to match strings
A way to test values against patterns
A way to create patterns
A way to format strings
5
What does the ??= operator do?
Assigns a value if the variable is null
Checks for null
Throws an exception
Creates a new variable
Submit Quiz