-
Notifications
You must be signed in to change notification settings - Fork 1
Null Operators
Mario Gutierrez edited this page Jan 7, 2017
·
7 revisions
Returns an alternate value on null.
Card cardB = cardA ?? new Card("2C"); // If cardA is null, return new Card.Provides safe method access. Also known as "Elvis operator."
Card cardA = deckA?.Get(1);If deckA turns out to be null, it will return null and not call Get().
- Abstract Classes
- Access Modifiers
- Anonymous Methods
- Anonymous Types
- Arrays
- Attributes
- Console I/O
- Constructors
- Const Fields
- Delegates
- Enums
- Exceptions
- Extension Methods
- File IO
- Generics
- Interfaces
- Iterators
- LINQ
- Main
- Null Operators
- Parameters
- Polymorphism
- Virtual Functions
- Reflection
- Serialization
- Strings
- Value Types
- "Base" Keyword
- "Is" and "As"
- "Sealed" Keyword
- nameof expression