TechBubbles Microsoft Technology BLOG

TagC# Opearators

C# ?? operator

The ?? operator in C# called null-coalescing operator is used to define a default value for a nullable value types and reference types. It returns the left-hand operand if it is not null and returns right-hand operand if it is null. example // ?? operator example . int? x = null; int y = x ?? –1; // Here the value of y will be –1. int i = GetValue() ?? default(int); Assigns the return value...

TechBubbles Microsoft Technology BLOG

Follow me

Archives

Tag Cloud