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

What are callback methods in c#?

718


Between windows authentication and sql server authentication, which one is trusted and which one is untrusted?

730


Can we have two main methods in c#?

742


What is Assembly. and Describe type of assembly. why most developer happy with private assembly.

812


What is the full form of GAC? Explain its uses?

790


What is a delegate in c#?

706


How does substring work in c#?

711


What is a console device?

689


What is whitespace in c#?

722


Give examples for reference types?

762


What is a long in c#?

693


How to exclude a property from xml serialization?

801


What is application object in c#?

719


how to insert the data from the grid view to database table though button click.pls send the answer to mail id suri1319@gmail.com

1734


What is difference between property and variable in c#?

674