?

Log in

Previous Entry | Next Entry

This question is taken from the book .NET interview questions written by Shivprasad Koirala.

“IS” keyword is useful to check if objects are compatible with a type. For instance in the below code we are checking if “ocust” object is a type of “Customer” class.

object ocust = new Customer();

if (ocust is Customer)
{

“AS” keyword helps to do conversion from one type to other type. For instance in the below code we are converting object to a string data type.

object o = "interview";
string str = o as string;

You can also see the below  youtube video created by www.questpond.com which explains the difference between "IS" and "AS" keyword practically.



We are thankful to http://www.questpond.com  for their continuous support to maintain this blog. They have c# and .NET interview question with answer video services , do visit our sponsor once.

Copy right www.questpond.com

Buy 600+ Real Time Interview Videos

Call +91-22-66752917 or mail us on questpond@questpond.com for more details on C#, .NET, ASP.NET, SQL Server interview question videos.

SQL Server interview question videos

Latest Month

January 2017
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Tags

Powered by LiveJournal.com