Is and as in c#?



Is and as in c#?..

Answer / Ziyaul Rehman

The 'is' keyword is used for type checking at runtime. It returns true if the object belongs to a specified type or its subclass. The 'as' keyword attempts to cast an object to a specific type, and if successful it assigns the result to the variable on the right side of the as keyword.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Practcle scenario where I can use abstract class and where I can use Interface

1 Answers   Jeevan Technologies,


In a stored procedure 4 select stmts there.If error comes in one select stmt will remaining normally executes?

7 Answers   Microsoft,


What are strong name assemblies?

1 Answers   CitiusTech,


Can hashtable have duplicate keys in c#?

1 Answers  


Is array thread safe c#?

1 Answers  


Please explain the basic string operations used in c#?

1 Answers  


What is type casting. Explain it with reference to classes.

2 Answers   HCL, JPMorgan Chase,


What is the name of the implicit input parameter of a set accessor for any property?

1 Answers   TCS,


What is value type and reference type?

3 Answers   TCS,


How do we achieve encapsulation in c#?

1 Answers  


Why do we need constructor in c#?

1 Answers  


What does the keyword “virtual” declare for a method or property?

1 Answers   Siebel,


Categories