1/51
Vocabulary-style flashcards covering C# operators and related syntax from the notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Addition operator (+)
Arithmetic operator that adds two operands.
Subtraction operator (−)
Arithmetic operator that subtracts the right operand from the left.
Multiplication operator (*)
Arithmetic operator that multiplies two operands.
Division operator (/)
Arithmetic operator that divides the left operand by the right.
Modulus operator (%)
Arithmetic operator that yields the remainder of the division.
Increment operator (++)
Arithmetic operator that increases a numeric value by one.
Decrement operator (--)
Arithmetic operator that decreases a numeric value by one.
Equal to (==)
Relational operator that checks if two values are equal; returns a boolean.
Not equal to (!=)
Relational operator that checks if two values are not equal.
Greater than (>)
Relational operator that checks if the left value is greater than the right.
Less than (<)
Relational operator that checks if the left value is less than the right.
Greater than or equal to (>=)
Relational operator that checks if the left value is greater than or equal to the right.
Less than or equal to (<=)
Relational operator that checks if the left value is less than or equal to the right.
Logical AND (&&)
Logical operator that returns true if both operands are true (short-circuits).
Logical OR (||)
Logical operator that returns true if at least one operand is true (short-circuits).
Logical NOT (!)
Logical operator that negates a boolean expression.
Simple assignment operator (=)
Assignment operator that assigns the right-hand value to the left-hand variable.
Compound assignment operators (+=, −=, *=, /=, %=, &=, |=, ^=, <
Assignments that combine an operation with assignment (e.g., a += b is a = a + b).
Bitwise AND (&)
Bitwise operator that yields 1 only if both corresponding bits are 1.
Bitwise OR (|)
Bitwise operator that yields 1 if at least one of the corresponding bits is 1.
Bitwise XOR (^)
Bitwise operator that yields 1 if only one of the corresponding bits is 1.
Bitwise NOT (~)
Bitwise operator that inverts all bits (bitwise complement).
Left shift (<<)
Bitwise operator that shifts bits to the left.
Right shift (>>)
Bitwise operator that shifts bits to the right.
Ternary operator (?:)
Special operator that provides a concise if-else expression: condition ? consequence : alternative.
Null-coalescing operator (??)
Operator that returns the left operand if it is not null; otherwise the right operand.
Null-coalescing assignment operator (??=)
Assigns the right-hand value to the left-hand operand only if the left-hand operand is null.
Type-testing operator (is)
Checks if an object is compatible with a given type.
Type-casting operator (as)
Attempts a safe cast; returns null if the cast fails.
Object creation operator (new)
Creates new instances of types.
Type operator (typeof)
Returns the System.Type object for a given type.
System.Type object
The runtime representation of a type; obtained via typeof in C#.
Size operator (sizeof)
Returns the size in bytes of an unmanaged type.
Overflow checking operator (checked)
Enables overflow checking for arithmetic operations.
Overflow checking operator (unchecked)
Disables overflow checking; arithmetic overflow wraps around.
Await operator (await)
Used with async methods to asynchronously wait for a task to complete.
Lambda operator (=>)
Defines lambda expressions (short anonymous functions).
Member access operator (.)
Accesses members of an object or type.
Parentheses causing grouping/casting ( )
Used for method calls, type casting, and grouping expressions.
Indexer/Array access operator ([])
Accesses elements of arrays or indexers.
Range operator (..)
Creates a range of indices for collections.
Index from end operator (^)
Used with the range operator to specify an index from the end.
Null-conditional operator (?.)
Safely accesses members or elements only if the preceding operand is not null.
Statement terminator (;)
Marks the end of a statement.
Code block delimiters ({})
Delimit blocks of code and array initializers.
Colon (:)
Separates inheritance/interface implementation, labels, case statements; also used in various syntax forms.
Separator (,)
Separates items in lists, arguments, and variable declarations.
Preprocessor directive (#)
Marks compiler preprocessor directives.
Verbatim string prefix (@)
Prefixes a string to treat backslashes literally and to allow multi-line strings; can prefix identifiers for keywords.
Interpolated string prefix ($)
Marks a string for interpolation, enabling {expression} substitutions.
Discard variable (_)
Underscore used as a discard placeholder in patterns or to ignore a value.
Digit separator (_)
Underscore used inside numeric literals to improve readability.