I am going through an example and I am not sure why they are doing this.
They are setting mySender to with IEmailSender….
IEmailSender mySender = new MyEmailSender();
why not just write
MyEmailSender mySender = new MyEmailSender();
as MyEmailSender already has the IEmailSender interface reference
Later in the code they could write
if necessary. But it isn’t necessarily right or wrong. They’re just trying to get a point across,
mySenderis anIEmailSenderregardless of the implementation.