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
You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?
Contrast between an interface and abstract class?
What is the difference between Static, Const and read only?
Is there a way to force garbage collection?
Is a valid int value?
Difference between a sub and a function in c#.
Is there throws keyword in c#?
What is the difference between first and firstordefault?
What is the difference between const and static read-only?
How does substring work in c#?
Explain why do I get an error (cs1006) when trying to declare a method without specifying a return type?
What are boxing and unboxing?
What is the difference between mobile application and desktop application?
Why do we need static in c#?
What is difference between gridview and form view?