What are extension methods in C#?
Extension methods allow developers to add method-like functionality to an existing type without modifying that type or creating a derived class.
C# interview questions covering advanced c# language features.
Open a question for the full answer, code and interview guidance.
Extension methods allow developers to add method-like functionality to an existing type without modifying that type or creating a derived class.
Pattern matching allows code to test an object's type, value, shape, or properties and optionally extract information at the same time.
A switch expression is a concise expression-based form of switch that returns a value based on pattern matching.
The null-coalescing operator returns its left operand when that value is not null; otherwise, it evaluates and returns the right operand.
Null-conditional operators safely access a member or index only when the target object is not null.
ref, out, and in pass arguments by reference rather than passing the parameter value normally.
Tuples allow a method or expression to group multiple values without defining a separate class or struct for every temporary result.
The yield keyword is used to implement an iterator without manually building and returning the entire collection.
Reflection allows code to inspect metadata about assemblies, types, properties, methods, attributes, constructors, and other members at runtime.
Attributes attach declarative metadata to assemblies, classes, methods, properties, parameters, and other program elements.