differences between the ways to cast an object

Posted by Vytas999 on Stack Overflow See other posts from Stack Overflow or by Vytas999
Published on 2010-03-30T21:19:53Z Indexed on 2010/03/30 21:23 UTC
Read the original article Hit count: 409

Filed under:
|

What are the differences between the following ways to cast an object?

1    object t = new Cat("Tom");
2    object j = new Mice("Jerry");

3    Console.WriteLine( t as Mice );
4    Console.WriteLine( (Cat)j );

© Stack Overflow or respective owner

Related posts about cast

Related posts about object