Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 13194 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > C# Interview Questions > What is the difference between DirectCas ...

What is the difference between DirectCast and CType ?

Interview question and answer by: Bharathi Cherukuri | Posted on: 4/24/2012 | Category: C# Interview questions | Views: 850 | | Points: 40


Answer:

DirectCast requires the object variable to be the same in both the run-time type and the specified type.
If the specified type and the run-time type of the expression are the same, then the run-time performance of DirectCast is better than that of CType.
Ctype works fine if there is a valid conversion defined between the expression and the type.

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


 Responses

Posted by: Umarali1981 | Posted on: 09 Aug 2012 07:40:30 AM | Points: 10 | Alert Moderator 

Please visit the following URL as well to know some more DirectCast and cType difference between points ,
http://onlydifferencefaqs.blogspot.in/2012/08/dotnet-programming-concepts-difference_8.html

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Bharathi Cherukuri

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 12:43:36 AM