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
Elements of CAS
Which file is taken by compiler when we have both file Application and Server Configuration file?
Explain what is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?
How inheritance works in .net?
Explain what is an anonymous method and how is it different from a lambda expression?
What is the use of UML in .Net
Explain what is a delegate?
What is strong-typing versus weak-typing? Which is preferred?
Can "this" be used within a static method?
Difference between user groups and code groups
Which dll is required to translate xml to sql in internet information server (iis)?
Difference between machine.config and web.config?
How boxing and unboxing occures in memory?
What is the difference between function and stored procedure?
Explain me what are the deferred execution and the immediate execution in linq?