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 is a shared assembly?

539


What is parsing?

527


Is null empty or whitespace c#?

499


What is the difference between read and readline in c#?

476


What is selector c#?

507






What is an int c#?

476


Can we create extension method for interface?

488


What is an enumerator c#?

508


What is windows application in c#?

469


What are the Types of assemblies that can be created in dotnet

656


What are strings in c#?

487


Define thread? Explain about multithreading?

566


what is partial assembly reference

503


Can a method be sealed in c#?

488


What is func delegate in c#?

502