What is the difference between as and is operators in c#?



What is the difference between as and is operators in c#?..

Answer / Hemendra Singh

The 'as' operator attempts to perform an implicit conversion between objects of different types and returns null if the conversion fails. The 'is' operator checks whether an object is an instance of a specific type or implements a specific interface without performing any conversion. If it does, it returns true; otherwise, it returns false.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Is lazy t thread safe?

1 Answers  


what's the Difference between DataView and DataTable?

10 Answers  


What are the Types of assemblies that can be created in dotnet

1 Answers  


What is asp net in c#?

1 Answers  


What is using in c#?

1 Answers  


Define delegation in .net?

1 Answers  


Why singleton class is sealed in c#?

1 Answers  


Explain dataset.acceptchanges method in .net?

1 Answers  


Can you create an instance of a static class?

1 Answers  


What is iqueryable?

1 Answers  


To catch any possible exception What is the C# syntax written ?

1 Answers   Siebel,


What is the purpose of namespace in c#?

1 Answers  


Categories