.Net Framework base types such as Int32, Int64, Boolean etc,. implement IConvertible interface but the metadata of these types do not contain the implementations of the methods defined in IConvertible interface such as ToByte, ToBoolean etc,.
I am trying to understand why the base types do not have the method implementations even though they implements IConvertible interface. Could anyone please help on this?
Take a closer look at the documentation -
Int32
implementsIConvertible
explicitly.When a class/struct implements an interface explicitly, you have to cast instances of that type to its interface before calling those methods