C# (Sharp) Programming Language Question: Download Questions PDF
An example of a ctype and directcast.
![C# (Sharp) Programming Language Interview Answer C# (Sharp) Programming Language Interview Question](https://globalguideline.com/public/images/interview/23.png)
Answer:
In the preceding example, the run-time type of Q is Double. CType succeeds because Double can be converted to Integer, but DirectCast fails because the run-time type of Q is not already Integer
Download C# (Sharp) Programming Language Interview Questions And Answers
PDF
Previous Question | Next Question |
Difference between directcast and ctype. | ctype(123.34,integer) - should it throw an error? Why or why not? |