Official documentation: Delegates
Official documentation: Task asynchronous programming model resposta correta –> var contacts = new List<string>();
Official documentation: Reflection
Official documentation: Deadlocks and race conditions
Official documentation: Anonymous Types
Official documentation: Dictionary<TKey,TValue> Class
==
compares contents.==
compares all values.==
compares reference identity.==
compares primitive value typesOfficial documentation: Deadlocks and race conditions
Official documentation: Objects
var<<!---->T> userData = new <<!---->T> { name = "John", age = 32 };
var userData = new { name = "John", age = 32 };
AType userData = new AType { name = "John", age = 32 };
Anonymous<T> userData = new Anonymous<T> { name = "John", age = 32 };
Official documentation: Anonymous Types
public void userInput(string charParameters) { }
dotnetpattern: LINQ OrderBy Operator
Official documentation: Language Integrated Query (LINQ) Overview
/_/ - Single Line
/_ - Multiline
// Multiline
/_ Single Line _/
//\* Multiline
/ Single Line
// Single Line
/* Multiline */
Official documentation: Using Properties
Official documentation: Abstract and Sealed Classes and Class Members
Official documentation: Thread pool characteristics
Official documentation: Inheritance
Official documentation: Operator overloading
Official documentation: Language Integrated Query (LINQ) Overview
Official documentation: List<T> Class
Official documentation: Starting tasks concurrently
Official documentation: Introduction to events
Official documentation: Arrays
enum AppState { OffLine, Loading, Ready }
Official documentation: Enumeration types
Official documentation: interface
Official documentation: Introduction to classes
Official documentation: Generic classes and methods
Official documentation: Abstract and Sealed Classes and Class Members
public int age="28"
c-sharpcorner: Type Safety in .NET
public class User {}
DeserializableAttribute
.public serializable class User {}
.SerializableAttribute
attribute.private serializable class User {}
.Official documentation: SerializableAttribute Class
Official documentation: Delegates
Official documentation: Static Members
Official documentation: Introduction to events
Official documentation: try-catch
Official documentation: Class inheritance
Official documentation: namespace
Official documentation: Using Properties
Official documentation: ThreadPool Class
Official documentation: Serialization
Official documentation: Delegates
Official documentation: Exceptions
break
and continue
keywords?break
keyword is used to break out of multiple iteration statements, while continue
can only break out of code blocks that have single iterations.break
keyword literally breaks out of a control flow statement, while continue
ignores the rest of the control statement or iteration and starts the next one.break
keyword literally breaks out of the current control flow code and stops it dead, while continue
keeps executing the code after an exception is thrown.break
keyword jumps out of an iteration and then proceeds with the rest of the control flow code, while continue
stops the executing code dead.Official documentation: Jump statements
get
and private set
?public int userID <get, set>;
public int userID [get, private set];
public int userID { get; private set; }
public int userID = { public get, private set };
Official documentation: Properties
Overriding virtual methods in a derived class is mandatory.
Overriding virtual methods in a derived class is not possible.
Virtual methods always need a default implementation.
Virtual methods cannot have default implementation.
resource overload
thread jumping
deadlock and race conditions
nothing, since this is what threading is for
Official documentation: race conditions
A string cannot be nullable.
string? myVariable
string myVariable = null
string(null) myVariable
Official documentation: nullable value types
No, you can declare an out in the parameter list.
Out variables are no longer part of C#.
You must declare it if it is a primitive type.
Yes.
People[..^2]
You cannot do this in C#.
People[..^3]
People[^2]
Explain: You can do this in C#. However, none of the above answers are correct. You could access the last two items by using People[^2..]
. Please see issue #3354 for more information.
See also: Official Documentation: Ranges
at compile time
after runtime
at runtime
after compile time
C-sharpcorner: Anonymous Types
Thread multitasking allows code to be executed concurrently
Thread multitasking allows code to be executed only when handling a user event.
Thread multitasking blocks code from being executed simultaneously to guard memory.
Thread multitasking adds single-threaded code blocks together.
Official Documentation: Threads
private string LastName;
Official Documentation: Accessibility Levels
string[] partyInvites = new string[10];
string[][] partyInvites = new string[10][];
string[][] partyInvites = new string[10]();
string <[]> partyInvites = new string <[10]>;
Official Documentation: Jagged Arrays
public class PremiumUser sub User {}
public class PremiumUser: User {}
public class PremiumUser -> sub User {}
public class User: PremiumUser {}
static InputManager.DebugString();
InputManager().DebugString;
new InputManager().DebugString();
InputManager.DebugString();