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

What type is string in c#?

0 Answers  


List the differences between method overriding and method overloading?

0 Answers  


What is the difference between interface and abstract class ?

2 Answers   Basware, BITS,


Define clr in .net?

0 Answers  


What you mean by delegate in c#?

0 Answers  


Whats an assembly? Describe the importance of assembly?

0 Answers   Siebel,


How do I trim a space in c#?

0 Answers  


What is encapsulation in csharp?

0 Answers  


How do I port "synchronized" functions from visual j++ to c#?

0 Answers  


What is difference between float and integer?

0 Answers  


Tell me something about Exceptions. What is the common exception class?

4 Answers   HCL,


What is the base class from which all value types are derived?

0 Answers  


Categories