C# Operators - Vocabulary Flashcards

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/51

flashcard set

Earn XP

Description and Tags

Vocabulary-style flashcards covering C# operators and related syntax from the notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

52 Terms

1
New cards

Addition operator (+)

Arithmetic operator that adds two operands.

2
New cards

Subtraction operator (−)

Arithmetic operator that subtracts the right operand from the left.

3
New cards

Multiplication operator (*)

Arithmetic operator that multiplies two operands.

4
New cards

Division operator (/)

Arithmetic operator that divides the left operand by the right.

5
New cards

Modulus operator (%)

Arithmetic operator that yields the remainder of the division.

6
New cards

Increment operator (++)

Arithmetic operator that increases a numeric value by one.

7
New cards

Decrement operator (--)

Arithmetic operator that decreases a numeric value by one.

8
New cards

Equal to (==)

Relational operator that checks if two values are equal; returns a boolean.

9
New cards

Not equal to (!=)

Relational operator that checks if two values are not equal.

10
New cards

Greater than (>)

Relational operator that checks if the left value is greater than the right.

11
New cards

Less than (<)

Relational operator that checks if the left value is less than the right.

12
New cards

Greater than or equal to (>=)

Relational operator that checks if the left value is greater than or equal to the right.

13
New cards

Less than or equal to (<=)

Relational operator that checks if the left value is less than or equal to the right.

14
New cards

Logical AND (&&)

Logical operator that returns true if both operands are true (short-circuits).

15
New cards

Logical OR (||)

Logical operator that returns true if at least one operand is true (short-circuits).

16
New cards

Logical NOT (!)

Logical operator that negates a boolean expression.

17
New cards

Simple assignment operator (=)

Assignment operator that assigns the right-hand value to the left-hand variable.

18
New cards

Compound assignment operators (+=, −=, *=, /=, %=, &=, |=, ^=, <

Assignments that combine an operation with assignment (e.g., a += b is a = a + b).

19
New cards

Bitwise AND (&)

Bitwise operator that yields 1 only if both corresponding bits are 1.

20
New cards

Bitwise OR (|)

Bitwise operator that yields 1 if at least one of the corresponding bits is 1.

21
New cards

Bitwise XOR (^)

Bitwise operator that yields 1 if only one of the corresponding bits is 1.

22
New cards

Bitwise NOT (~)

Bitwise operator that inverts all bits (bitwise complement).

23
New cards

Left shift (<<)

Bitwise operator that shifts bits to the left.

24
New cards

Right shift (>>)

Bitwise operator that shifts bits to the right.

25
New cards

Ternary operator (?:)

Special operator that provides a concise if-else expression: condition ? consequence : alternative.

26
New cards

Null-coalescing operator (??)

Operator that returns the left operand if it is not null; otherwise the right operand.

27
New cards

Null-coalescing assignment operator (??=)

Assigns the right-hand value to the left-hand operand only if the left-hand operand is null.

28
New cards

Type-testing operator (is)

Checks if an object is compatible with a given type.

29
New cards

Type-casting operator (as)

Attempts a safe cast; returns null if the cast fails.

30
New cards

Object creation operator (new)

Creates new instances of types.

31
New cards

Type operator (typeof)

Returns the System.Type object for a given type.

32
New cards

System.Type object

The runtime representation of a type; obtained via typeof in C#.

33
New cards

Size operator (sizeof)

Returns the size in bytes of an unmanaged type.

34
New cards

Overflow checking operator (checked)

Enables overflow checking for arithmetic operations.

35
New cards

Overflow checking operator (unchecked)

Disables overflow checking; arithmetic overflow wraps around.

36
New cards

Await operator (await)

Used with async methods to asynchronously wait for a task to complete.

37
New cards

Lambda operator (=>)

Defines lambda expressions (short anonymous functions).

38
New cards

Member access operator (.)

Accesses members of an object or type.

39
New cards

Parentheses causing grouping/casting ( )

Used for method calls, type casting, and grouping expressions.

40
New cards

Indexer/Array access operator ([])

Accesses elements of arrays or indexers.

41
New cards

Range operator (..)

Creates a range of indices for collections.

42
New cards

Index from end operator (^)

Used with the range operator to specify an index from the end.

43
New cards

Null-conditional operator (?.)

Safely accesses members or elements only if the preceding operand is not null.

44
New cards

Statement terminator (;)

Marks the end of a statement.

45
New cards

Code block delimiters ({})

Delimit blocks of code and array initializers.

46
New cards

Colon (:)

Separates inheritance/interface implementation, labels, case statements; also used in various syntax forms.

47
New cards

Separator (,)

Separates items in lists, arguments, and variable declarations.

48
New cards

Preprocessor directive (#)

Marks compiler preprocessor directives.

49
New cards

Verbatim string prefix (@)

Prefixes a string to treat backslashes literally and to allow multi-line strings; can prefix identifiers for keywords.

50
New cards

Interpolated string prefix ($)

Marks a string for interpolation, enabling {expression} substitutions.

51
New cards

Discard variable (_)

Underscore used as a discard placeholder in patterns or to ignore a value.

52
New cards

Digit separator (_)

Underscore used inside numeric literals to improve readability.