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 is lazy loading c#?

0 Answers  


How many types of constructors are available in c#?

0 Answers  


Explain the difference between Response.Write () and Response.Output.Write ().

0 Answers   Atos Origin,


What is delegation in oops?

0 Answers  


Which is faster dictionary or list?

0 Answers  


Can you store multiple data types in System.Array?

5 Answers  


What is lazy class in c#?

0 Answers  


What?s the difference between an interface and abstract class?

6 Answers   Mind Tree, Siebel,


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

0 Answers  


Whats an assembly? Describe the importance of assembly?

0 Answers   Siebel,


what is the meaning of Object lifetime in OOPS

0 Answers   HCL,


Can a method return multiple values in c#?

0 Answers  


Categories