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 |
[[posterous-content:DInBsGyDprbevscbAqir]][[posterous-content:tCqFDceffackeocgmFHj]][[posterous-content:woJfbobfvumijckBwDuu]][[posterous-content:JjldhnumJhoBzlmcfcpi]] |