Codeasy.net C# Beginner – Type Conversion
Day 48 #100DaysOfCode
Implicit data conversion happens when you change from a lower data type to a higher data type, such as converting from byte to int to double. When you change to a higher bitrate form of data the conversion can happen automatically as it is understood the data will be larger and can accommodate whatever you are converting from. The same is not true in reverse.
To convert data to a lower form of bitrate, such as from double to int, you must declare your intent to do so because there will be data loss after the conversion. This is known as an explicit data conversion, or casting.
Casting allows you to drop data you don’t need to reduce the amount of data stored in a variable by changing its type. Casting also allows you to ensure you are working with data in exactly the manner you need to.