Difference between byte vs Byte data types in C# [duplicate]

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 situations 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
}

For detailed other alias, please follow the link.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)