It is a text editor specifically for writing C# code.
It provides a runtime environment (CLR) and a class library for building and running applications.
It is a compiler that converts C# code directly into machine code.
It is a graphical user interface (GUI) designer for Windows applications.
Value types hold their data directly, while reference types hold a pointer to the memory location of the data.
Assigning one reference type variable to another copies the actual object.
Value types can only be numeric types like int and float, while reference types are for text like string.
int
float
string
Value types are stored on the heap and reference types are stored on the stack.
myInt
double myDouble = 9.78; int myInt = (int)myDouble;
10
9
The code will cause a compile-time error.
9.78
while
do-while
A while loop is used for iterating over collections, while a do-while loop is for conditional logic.
A do-while loop checks its condition at the end of each iteration, guaranteeing its body is executed at least once.
A while loop executes at least once, whereas a do-while loop might not execute at all.
There is no functional difference; they are syntactically interchangeable.
Method recursion
Method overriding
Method overloading
Method hiding
Polymorphism
Abstraction
Inheritance
Encapsulation
Abstract classes can have fields and constructors, whereas interfaces cannot.
A class can inherit from multiple abstract classes but only implement one interface.
An interface can contain implementation for its methods, while an abstract class cannot.
Interfaces are used for 'is-a' relationships, while abstract classes are for 'has-a' relationships.
try-catch-finally
finally
Only when an exception is thrown in the try block.
try
Only if the specific exception is caught by a catch block.
catch
Only when no exception is thrown in the try block.
Always, regardless of whether an exception was thrown or caught.
List<T>
Dictionary<TKey, TValue>
Queue<T>
HashSet<T>
To store a collection of unique items in a sorted order.
To store a collection of key-value pairs, allowing for fast retrieval of a value using its key.
To enforce a last-in, first-out (LIFO) data structure.
To store an ordered list of items that can be accessed by an integer index.
using
FileReader
File
StreamWriter
StringWriter
It improves the runtime performance of loops by compiling them to native machine code.
It provides a standardized, declarative syntax for querying various types of data sources (collections, databases, etc.).
It is the only way to handle file input/output operations in modern C#.
It allows C# code to be executed directly within a SQL database.
numbers
from num in numbers select num where num % 2 == 0;
from num in numbers where num % 2 == 0 select num;
select num from numbers where num % 2 == 0;
numbers.Select(num => num % 2 == 0);
All done? Get your grade