Hi,
Can someone explain the idea behind casting to an interface?
For example:
-> I have an IInterface that contains a Read() method.
-> I have an object "obj" that implements IInterface.
Why would someone do the following and what does it mean?
Object obj = new Object();
IInterface var = (IInterface) obj
var.Read()
Thanks
Can someone explain the idea behind casting to an interface?
For example:
-> I have an IInterface that contains a Read() method.
-> I have an object "obj" that implements IInterface.
Why would someone do the following and what does it mean?
Object obj = new Object();
IInterface var = (IInterface) obj
var.Read()
Thanks
Comment