The third line of your code snippet:
byte z = x + y;
actually means
byte z = (int) x + (int) y;
So, there is no + operation on bytes, bytes are first cast to integers and the result of addition of two integers is a (32-bit) integer.
More Related Contents:
- Convert string[] to Array
- How can I convert String to Int?
- Converting a String to DateTime
- Convert integer to hexadecimal and back again
- How to convert UTF-8 byte[] to string
- How to convert numbers between hexadecimal and decimal
- Setting a property by reflection with a string value
- How to convert a gi-normous integer (in string format) to hex format? (C#)
- Does it make sense to use “as” instead of a cast even if there is no null check? [closed]
- How to convert a Decimal to a Double in C#?
- Converting string to double in C#
- Difference between Convert.ToString() and .ToString()
- Fast way to convert a two dimensional array to a List ( one dimensional )
- Convert string to nullable type (int, double, etc…)
- convert double to int
- Cast class into another class or convert class to another
- What is the difference between Convert.ToInt32 and (int)?
- Why can’t I use interface with explicit operator? [duplicate]
- Invalid cast from ‘System.Int32’ to ‘System.Nullable`1[[System.Int32, mscorlib]]
- Converting an int[] to byte[] in C#
- How to convert Decimal to Double in C#?
- How to convert string to integer in C#
- What is the difference between casting and conversion? [duplicate]
- Converting String To Float in C#
- Type result with conditional operator in C#
- C# unsafe value type array to byte array conversions
- Is there any generic Parse() function that will convert a string to any type using parse?
- How to convert from System.Enum to base integer?
- Cannot implicitly convert type ‘customtype’ to ‘othercustomtype’
- WPF – converting Bitmap to ImageSource