directcast(123.34,integer) - should it throw an error? Why
or why not?
Answers were Sorted based on User's Feedback
Answer / debasis sengupta
directcast(123.34,integer) would throw an InvalidCast
exception since it requires the runtime type of the object
variable to be same as the specified type. In this case
runtime type of 123.34 (double) doesn?t match with integer.
but for ctype(123.34,integer) - it would work fine. As the
runtime type of 123.34 would be double, and Double can be
converted to Integer.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / 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 |
how encapsulation is implemented in c#
Write a program to create a user control with name and surname as data members and login as method and also the code to call it. (Hint use event delegates) Practical Example of Passing an Events to delegates
Can You Prevent Your Class From Being Inherited By Another Class?
Why dependency injection is used in c#?
What is inumerable?
What is an event in c#?
What are the 2 types of data types available in c#?
What Is A Satellite Assembly?
0 Answers PUCIT, Siebel Systems,
What are the extension methods in c#?
What is event and delegates in c#?
How do you concatenate in c#?
Howmany five tracing levels in System.Diagnostics.TraceSwitcher? Why they are using?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)