private void button1_Click(object sender, EventArgs e)
{
ScaryScary fingersTheClown = new ScaryScary(“big shoes”, 14);
FunnyFunny someFunnyClown = fingersTheClown;
IScaryClown someOtherScaryclown = someFunnyClown as ScaryScary;
someOtherScaryclown.Honk()
}
It works too this way , using a cast :
ScaryScary fingersTheClown = new ScaryScary("big shoes", 14);
FunnyFunny someFunnyClown = fingersTheClown;
((ScaryScary)someFunnyClown).Honk();
it works also in all the examples with the keyword "as".
Googling here and there , i found this explanation :
<< ...The as operator is similiar to a cast but on any conversion failure null is returned as oppose to raising an
exception...>>
Hope this entry could be of general interest












