What is the Difference between directcast and ctype?
Answer Posted / narayan sahu(netx)
The difference between the two keywords is that CType
succeeds as long as there is a valid conversion defined
between the expression and the type, whereas DirectCast
requires the run-time type of an object variable to be the
same as the specified type. If the specified type and the
run-time type of the expression are the same, however, the
run-time performance of DirectCast is better than that of
CType. DirectCast throws an InvalidCastException error if
the argument types do not match.
| Is This Answer Correct ? | 12 Yes | 3 No |
Post New Answer View All Answers
How inheritance works in .net?
Explain why do we use the “using” statement?
What are the two main parts of the .net framework?
what user controls are and what server controls are and the differences between the two.
What is operator overloading in .net?
What is a variable of implicit type and what is its scope?
What is Finalizer in .NET define Dispose and Finalize ?
Name the classes that are introduced in the system.numerics namespace.
Explain the different types of proxy patterns?
What is managed code and managed data in .net?
Can you explain what do you understand about web service?
What are the new thee features of com+ services, which are not there in com (mts)?
Explain about .Net products?
Explain different types of html, web and server controls.
State the various features present in .NET?