What is the Difference between directcast and ctype?

Answer Posted / aravindreddy

DirectCast requires the run-time type of an object variable
to bethe same
as the specified type.The run-time performance
ofDirectCast is better
than that of CType, if the specified type and the run-time
typeof the
expression are the same.
Ctype works fine if there is a valid conversion defined
between the
expression and the type.

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is garbage collection in .net? Explain the garbage collection process?

653


Explain the difference between task and thread in .net?

591


What are the new 2.0 features useful for?

738


What is Event - Delegate? clear syntax for writing a event delegate

1648


How does u handle this COM components developed in other programming languages in .NET?

1767






What is concurrency? How will you avoid concurrency when dealing with dataset?

677


What is the use of UML in .Net

693


What's the problem with .net generics?

643


How to debug failed assembly binds?

682


Is .net core stable?

580


How is .net able to support a lot of languages?

600


Explain me why do we use msmq?

649


How to view a .NET assembly?

680


The project which you have made, which methodology did you use?

685


What is the microsoft .net?

684