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
ConsoleApp_Lesson4 Quiz
Answer all questions to test your understanding
1
Which namespace contains file handling classes in C#?
System.IO
System.File
System.Data
System.Collections
2
Which method writes text to a file and overwrites if the file already exists?
File.AppendAllText()
File.WriteAllText()
File.AddText()
File.CreateText()
3
What is the purpose of the 'using' statement with StreamReader/StreamWriter?
To make the code run faster
To automatically dispose of resources
To import namespaces
To create a new file
4
How do you check if a file exists in C#?
File.Exists()
File.IsExists()
File.CheckExists()
File.HasFile()
5
Which method reads all lines from a file into a string array?
File.ReadAllText()
File.ReadAllLines()
File.ReadLines()
File.ReadText()
Submit Quiz