However the return value is defined as type ‘System.Object’, which means that the user still has to cast this to the actual type:
This is cumbersome and error-prone because the cast may fail at runtime.
Use the following pattern to provide a type-safe implementation of this interface:
This example implements a type-safe Clone() method, so the user does not have to cast the result. But we still have to implement the interface-method that returns a System.Object. This is done through explicit interface method implementation.
This pattern is easier for the user of the class, and it has the benefit that the compiler will now guarantee that the returned object is always of the correct type.