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...


Difference between direct type casting and using "as" keyword?



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

Post New Answer

More C Sharp Interview Questions

Name some properties of array.

0 Answers  


update data in an xml file which resides in solution itself, using silverlight 4.0

0 Answers  


What's the difference between System.String and System..StringBuilder in C#?

0 Answers   PUCIT,


What is difference between c sharp and c#?

0 Answers  


What is Covariance and contravariance in C#?

0 Answers   HCL,


Is c# slower than java?

0 Answers  


What is the use of static members with example using c#.net.

0 Answers  


Why it's said that writing into .NET Application Configuration Files is a Bad Idea?

0 Answers   DELL,


explain Garbage collector’s functionality on unmanaged code

0 Answers   DELL,


How?s method overriding different from overloading?

4 Answers  


if a method is marked as protected internal who can access it?

0 Answers   Siebel Systems,


How do you serialize an object?

0 Answers  


Categories