Could someone please helpme to understand if the following codes are same. If not what\'s the difference between class and interfance instantiation.
IUnityCo
There's really no such thing as "interface instantiation", but there are interface variables. The first line is an example of one such variable.
With the first line, you could instantiate container to be any concrete class that implements IUnityContainer. With the second line, the container object could only be instantiated from the UnityContainer class or a derived class.
When you use interface variables in your code, it allows you to more easily switch out the concrete implementation, which makes your code more flexible.