C# (Sharp) Programming Language Question:
Download Questions PDF

ctype(123.34,integer) - should it throw an error? Why or why not?

Answer:

Answer1
It would work fine. As the runtime type of 123.34 would be double, and Double can be converted to Integer.

Answer2
the ctype(123.34,integer) will work fine no errors

Download C# (Sharp) Programming Language Interview Questions And Answers PDF

Previous QuestionNext Question
An example of a ctype and directcast.directcast(123.34,integer) - should it throw an error? Why or why not?