What does File I/O stand for?
File Input and Output
What is a constructor in C#?
A special method used to create instances of a class
Which of the following is true about constructors?
They must have the same name as the class
What keyword is used to define a property in C#?
get and set
What is the naming convention for properties in C#?
Start with an uppercase letter
What is the first index of an array in C#?
0
Which method checks if a file exists in C#?
File.Exists()
Which property is used to find the total number of elements in an array?
Length
Which method from the Array class would you use to sort an array?
Array.Sort()
Which of the following is true about arrays in C#?
Arrays are reference types
What is a primary advantage of using a collection in C#?
Collections help manage and manipulate groups of objects efficiently
Which method is automatically called when an object is printed using WriteLine()?
ToString()
Which class is used to check if a folder exists?
Directory
What is the purpose of using new when creating an object?
It allocates memory and calls the constructor
Which collection type can dynamically resize and store any data type as an object?
List
What is a jagged array in C#?
An array where each element is another array of potentially different length
What are the core operations in a Queue<T>?
Enqueue and Dequeue
Which operation in Stack<T> returns the top value without removing it?
Peek
What is the correct method to create a new folder?
Directory.CreateDirectory()
What principle does the Queue<T> collection follow?
First-In-First-Out
Which class allows reading characters from a text file line by line?
StreamReader
Which of the following correctly declares and initializes a string array with 25 elements?
A. string[] lastName = {25};
B. string lastName = new string[25];
C. string[] lastName = new string[25];
D. string lastName[] = new string[25];
C. string[] lastName = new string[25];
What is the purpose of : in C#
Inheritance
Which class allows writing to a binary file?
BinaryWriter
Which method is used to write a complete string to a text file in one step?
File.WriteAllText()