With C#, you can define custom casting implementation between two types. This implementation will be used when casting from one type to the other in your code.
Exercise : Implement an implicit and explicit casting
In the following exercise, you have two classes, Car and Vehicle.
The goal is to implement an implicit casting of Car to Vehicle. The casting must respect these guidelines:
Brand / Model (Year) / License Plate
Be careful when implementing custom casting operators. They can be useful is certain situations, but using them is not very intuitive and can be misleading.
The #1 tech hiring platform