Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

byte: practical reference

byte: practical reference: byte is an 8-bit unsigned integer ranging from 0 through 255.

Version: C# built-in type reference; .NET 10 runtime

Syntax

byte value

byte is an 8-bit unsigned integer ranging from 0 through 255.

Use it for raw bytes and small non-negative values.

Arithmetic promotes byte to int, so a result needs a cast or compound assignment.

Overflow throws in checked context and wraps modulo 256 in unchecked context.

The complete program actually uses byte; its exact expected stdout is System.Byte.

Examples

using System;

Console.WriteLine(typeof(byte).FullName);

Result

System.Byte

The complete program actually uses `byte`; its exact expected stdout is `System.Byte`.

Sources