The only relation to c# that I can think of would be the "is" and "as" keywords.
"is" can be used to test what type of object an object reference is. For instance [no pun intend, or thought of I think :)] a developer could write:
if(m_car is MiniCooper)
{
...
they would be saying that if the m_car variable is of the type MiniCooper then do something.
The "as" keyword is used to "cast" a type to another type. So you could write
if(m_car is MiniCooper)
{
MiniCooper mc = m_car as MiniCooper;
The "as" keyword is slightly differnt to the Explicit cast (MiniCooper mc = (MiniCooper) m_car; because if the cast dosn't work with an "as" then the mc local variable will be null, rather than throwing an "InvalidCastException".
I hope this helps.
| Technorati Tags |
| minicooper [feed], instanceof [feed], object reference [feed], keyword [feed], pun [feed], c# [feed], as [feed], is [feed], cast [feed], javascript [feed] |
| My Related Documents |
| C#, .Net Framework: C# 3.0. Ugh!, C#, .Net Framework: C# 3.0 and LINQ |
| Related Amazon Books |
| UML Pocket Reference: (UK)/(USA), BusinessObjects: The Complete Reference (Complete Reference S.): (UK)/(USA), Microsoft Visual C# .NET (Core Reference): (UK)/(USA), Visual C#.NET Language Reference: (UK)/(USA), Successful Keyword Searching: Initiating Research on Popular Topics Using Electronic Databases: (UK)/(USA), Automatic Keyword Classification for Information Retrieval: (UK)/(USA), DHTML Utopia: Modern Web Design Using JavaScript & DOM: (UK)/(USA), JavaScript: The Definitive Guide: (UK)/(USA) |
| Related Images From Flickr |
![]() ![]() ![]() ![]() |
Comments: [Add New]
Thanks! I actually *was* looking for "c# instanceof" and found this post!
By , at Friday, May 19, 2006 2:35:00 PM
hi!
I think it's people like me who switch from Java to C# that use such queries. It really is the fastest way to find how "instanceof" is in C#... Thanks a lot!
Hey dude, "c# instanceof" query gives your site as a first link on google!
Lots of kudos to actually posting the proper way :)
Greets from NL.
By Vladimir Lazarenko, at Thursday, January 24, 2008 6:30:00 PM






