© { JSL }
62
Text Box: as
as
Folded Corner:
·the as operator is similar
wperforms the conversion if the type is supported
wreturns null if its not
static void GreyHole(object o)
{
    IPluckable ip = o as IPluckable;
    if (ip != null)
    {
        ip.Pluck();
        ...
    }
}
static void Main()
{
    GreyHole(new Violin());
    GreyHole(42);
}
check once