C# (Sharp) Programming Language Question: Download Questions PDF
directcast(123.34,integer) - should it throw an error? Why or why not?
![C# (Sharp) Programming Language Interview Answer C# (Sharp) Programming Language Interview Question](https://globalguideline.com/public/images/interview/23.png)
Answer:
It would throw an InvalidCast exception as the runtime type of 123.34 (double) doesnt match with Integer.
Download C# (Sharp) Programming Language Interview Questions And Answers
PDF
Previous Question | Next Question |
ctype(123.34,integer) - should it throw an error? Why or why not? | Difference between a sub and a function in C#. |