1

What is the benefit of creating an instance of an object using the Interface's name?

Let's say I have an Interface called ISampleInterface, and a class called Customer that implements ISampleInterface. What is the difference between creating an object like this:

ISampleInterface customer = new Customer();

and this:

Customer customer = new Customer();

0 Answers0