C# Language Keywords ushort

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

A numeric type used to store 16-bit positive integers. ushort is an alias for System.UInt16, and takes up 2 bytes of memory.

Valid range is 0 to 65535.

ushort a = 50; // 50
ushort b = 65536; // Error, cannot be converted
ushort c = unchecked((ushort)65536); // Overflows (wraps around to 0)


Got any C# Language Question?