The byte
keyword is an alias for the System.Byte
data type.
They represent the same data type, so the resulting code is identical. There are only some differences in usage:
You can use byte
even if the System
namespace is not included. To use Byte
you have to have a using System;
at the top of the page, or specify the full namespace System.Byte
.
There are a few sitations where C# only allows you to use the keyword, not the framework type, for example:
.
enum Fruits : byte // this works
{
Apple, Orange
}
enum Fruits : Byte // this doesn't work
{
Apple, Orange
}