Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

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?

917


Contrast between an interface and abstract class?

968


What is the difference between Static, Const and read only?

1073


Is there a way to force garbage collection?

1013


Is a valid int value?

916


Difference between a sub and a function in c#.

967


Is there throws keyword in c#?

906


What is the difference between first and firstordefault?

907


What is the difference between const and static read-only?

929


How does substring work in c#?

973


Explain why do I get an error (cs1006) when trying to declare a method without specifying a return type?

825


What are boxing and unboxing?

911


What is the difference between mobile application and desktop application?

881


Why do we need static in c#?

953


What is difference between gridview and form view?

1007