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 Question
C# (Sharp) Programming Language Interview Question

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 QuestionNext Question
ctype(123.34,integer) - should it throw an error? Why or why not?Difference between a sub and a function in C#.