In C#, Byte Struct is used to represent 8-bit unsigned integers. The Byte is an immutable value type and the range of Byte is from 0 to 255. This class allows you to create Byte data types and you can perform mathematical and bitwise operations on them like addition, subtraction, multiplication, division, XOR, AND etc.
|MaxValue||It is the largest possible value of a Byte. This field is constant.|
|MinValue||It is the smallest possible value of a Byte. This field is constant.|
The minimum value of Byte: 0 The maximum value of Byte: 255
|CompareTo(Object)||Compares the current instance to a specified object and returns a sign of their relative values.|
|CompareTo(Byte)||Compares this instance to a specified 8-bit unsigned integer and returns an indication of their relative values.|
|Equals(Object)||To get a value which indicates whether the current instance is equal to a specified object or not.|
|Equals(Byte)||Returns a value indicating whether this instance and a specified Byte object represent the same value.|
|GetHashCode()||Returns the hash code for this instance.|
|GetTypeCode()||Returns the TypeCode for value type Byte.|
|Parse()||Converts the string representation of a number to its Byte equivalent.|
|ToString()||Converts the value of the current Byte object to its equivalent string representation.|
|TryParse()||Tries to convert the string representation of a number to its Byte equivalent, and returns a value that indicates whether the conversion succeeded.|
Comparison 1: -8 Comparison 2: 30 Comparison 3: 0 Comparison 4: 22
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.