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
ClassesAndOOP_Lesson2 Quiz
Answer all questions to test your understanding
1
What is a field in a C# class?
A method that returns data
A variable declared inside a class
A property that validates data
A constructor that initializes data
2
What is the purpose of a property in C#?
To store data without validation
To provide controlled access to fields with get and set accessors
To create methods that return data
To define the constructor of a class
3
What is an auto-implemented property in C#?
A property that requires manual backing field implementation
A property where the compiler automatically generates the backing field
A property that cannot be modified
A property that only has a getter
4
What does the 'init' accessor do in a property?
Allows the property to be set only during object initialization
Makes the property read-only
Makes the property write-only
Allows the property to be set at any time
Submit Quiz