The two types of variables in C#
What are reference and Value types
The four kinds of loops in C#
What are for, While, do-While, and foreach
This is the only non-generic collection in C#
What is an array?
This keyword flags a class (and its members) so that they cannot be declared, but derived classes must include any marked members and their implementations
What is abstract
It is Epic (and microsoft) convention to start these types with 'I'
What is an interface?
Reference types are stored in this piece of memory
What is the Heap?
In order to create a custom exception, you must extend it from this class.
What is Exception? (Hell yeah it was that easy)
This is like an array, but has a flexible length that doesn't need to be declared right away.
What is a list?
This is the default access modifier for a class in C# (shoutouts to Josh)
What is Internal
These are the only things you should use camelCase for.
Local Variables, Parameters
(With s_ and _ prefix for private/static variables)
M, D and F. Appending these characters to a number casts it to these types, respectively.
Decimal, Double, Float
Like 'out', this keyword allows you to mark a parameter so that changes made to it are passed back out. Unlike with out, the function is not required to make changes.
What is 'ref'?
This is the command used to add elements to a Queue
What is enqueue?
This keyword flags a class so that no classes can be derived from it
This is required of any delegate functions in order to support multicasting
What is null return type
This operator allows you to safely assign a value which might be null, and assign a default value otherwise.
What is the null-coalescing operator? (??)
In this situation, you need a 'finally' block, otherwise the code after a try/catch statement won't execute.
What is Try/Catch return a value
OR
What is an exception thrown in the catch bloc
These are the four generic collections available in C#
Using this keyword after a constructor in a derived class allows
What is base?
The issue in this code:
int x = 4;
switch (x) {
case 1:
//code
break;
case 3:
//code
break;
case default:
//code
break;
}
The default case is just called with default: you don't need to use the case keyword
This data type allows for easier manipulation of strings, whose immutable nature otherwise makes them process-intensive to edit
What is StringBuilder?
Assuming val has been declared appropriately beforehand, this the value of val after this code is run
int a=2,b=3,c=4,d=6;
val = b-c*a == c%3-d;
What is true?
First in First out/Last in First out
Use this convention when declaring a static member
What is s_CamelCase
How does a public delegate field differ from an event of the same delegate type in a class?
(What is) The public delegate field can be invoked outside of the class directly, events cannot.