adspace


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

Answer Posted / debasis sengupta

directcast(123.34,integer) would throw an InvalidCast
exception as the runtime type since it requires the run-
time type of an object variable to be same as the specified
type. In this case runtime type of 123.34 (double) doesn?t
match with integer.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why can't we use a static class instead of singleton?

955


What is expression tree in c#?

998


How do you inherit a class into other class in c#?

995


What is an abstract class c#?

969


How to assign Null value to Var?

1064


Which namespaces are necessary to create a localized application?

1142