© { JSL }
61
Text Box: is
is
Folded Corner:
·use is operator to check for type support
wreturns true or false
wa cast can throw an InvalidCastException
static void GreyHole(object o)
{
    if (o is IPluckable)
    {
        IPluckable ip = (IPluckable)o;
        ip.Pluck()
        ...
    }
}
static void Main()
{
    GreyHole(new Violin());
    GreyHole(42);
}
check once
check twice
cast