Difference between direct type casting and using "as" keyword?
Answer / amitabh dubey
Explicit cast throws an InvalidCastException if the object
can not be casted. you have to
Keep the casting under try / catch block to handle the
exception.
Instead you can use as operator which return null if it
can not cast the object.
| Is This Answer Correct ? | 25 Yes | 0 No |
Are c and c# the same thing?
What is dao in c#?
What are the Types of compatabilities and explain them
What is list array in c#?
What is a clr host?
What is difference between string and string builder?
Why we put script in head of asp.net page Why not in body?
Is predicate a functional interface?
How to navigate from one page(form) to another page(form) using C#.net...please give me the example
What?s an interface class?
What are the Features in .net framework 1.1
What are the differences between static, public and void in c#?
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)