IS vs AS Keyword | C# Interview Questions with Answers | Csharp Interview Questions | IS vs AS in C#
Вставка
- Опубліковано 24 лют 2014
- See our other Step by Step video series below :-
For more such videos visit www.questpond.com
For more such videos subscribe / questpondvideos
See our other Step by Step video series below :-
JavaScript Interview Questions: • JavaScript Interview Q...
C# Interview Questions:- • C# Interview Questions...
Abstract class vs Interface in C# :- • Abstract Class vs Inte...
C# tutorial for beginners(4 hrs):- • C# Tutorial for Beginn...
Abstract class vs Interface in C# :- • Abstract Class vs Inte...
ASP.NET MVC Core Interview Questions with answers:- • ASP.NET MVC Interview ...
Learn Angular tutorial step by step tinyurl.com/ycd9j895
Learn Azure Step by Step:- • Azure Tutorial for Beg...
Azure AZ-900 fundamentals certification :- • AZ 900 Certification |...
Angular Interview Questions and Answers :- • Angular Interview Ques...
Learn MVC 5 step by step in 16 hours:- • Learn ASP.NET MVC 5 ( ...
Learn Design Pattern Step by Step goo.gl/eJdn0m
Learn MSBI Step by Step in 32 hours:- goo.gl/TTpFZN
Learn SQL Server Step by Step tinyurl.com/ja4zmwu
Python Tutorial for Beginners:- • Python Tutorial for Be...
Learn Data Science in 1 hour :- tinyurl.com/y5o7qbau
Learn Power BI Step by Step:- tinyurl.com/y6thhkxw
PHP Interview Questions : • PHP Interview Question...
Learn Tableau step by step :- tinyurl.com/kh6ojyo
This is a interesting c# interview question which explains the difference between "IS" and "AS" keyword.
"IS" keyword is useful to check if objects are compatible with a type while "AS" keyword helps to do conversion from one type to other type
We are also distributing a 100 page Ebook ".NET Interview Question and Answers". If you want this ebook please share this video in your facebook/twitter/linkedin account and email us on questpond@questpond.com with the shared link and we will email you the PDF.
-----------------------------------------------------------------------------------------------
For more details :-
🌐 Website : www.questpond.com
📱 Mob. No. : +91-9967590707 / +91 7700975156 / +91-22-49786776
📧Email : questpond@questpond.com / questpond@gmail.com / questpond@yahoo.com
Share, Support, Subscribe and Connect us on!!!
UA-cam: / questpondvideos
Twitter: / questpond
Instagram : / questpond
Facebook : / questpond
#DifferenceBetweenIS&AS #ISvsASKeyword #IS&ASKeywordinC# #CSharpInterviewQuestions #C#InterviewQuestionsforFreshers #C#Tutorial
ASP.NET, C# Job Market : ua-cam.com/video/H3JEWAp32-s/v-deo.html
25+ OOPS Interview Questions : ua-cam.com/video/u99wAoBjDvQ/v-deo.html
30 Important C# Interview Questions : ua-cam.com/video/BKynEBPqiIM/v-deo.html
Software Architecture Interview Questions : ua-cam.com/video/AtTgcbLOqMM/v-deo.html
20+ SQL Server Interview Questions : ua-cam.com/video/SEdAF8mSKS4/v-deo.html
10+ Power BI Interview Questions : ua-cam.com/video/Cozc9WNBRt4/v-deo.html
20 MSBI Interview Questions : ua-cam.com/video/Nw_sHEKnOUE/v-deo.html
SQL Server Joins : ua-cam.com/video/KTvYHEntvn8/v-deo.html
SQL Step by Step - ua-cam.com/video/uGlfP9o7kmY/v-deo.html
Angular Step by Step Tutorial for Beginners : ua-cam.com/video/-9VcW7MBDs8/v-deo.html
25 Angular Interview Questions : ua-cam.com/video/-jeoyDJDsSM/v-deo.html
25 Important ASP.NET Interview Questions : ua-cam.com/video/pXmMdmJUC0g/v-deo.html
35 Important JavaScript Interview Questions : ua-cam.com/video/Zb4dPi7CANU/v-deo.html
20 MySQL Interview Questions : ua-cam.com/video/9hfjC-BpY20/v-deo.html
5 MSBI Interview Questions : ua-cam.com/video/5E815aXAwYQ/v-deo.html
20 PHP Interview Questions : ua-cam.com/video/1bpNSynUrl8/v-deo.html
This channel is one of the best C# teacher. Very clear explanation.
The is and as operators in C# verify whether the specified interface is implemented or not. The is
operator is used to check the compatibility between two types or classes. It returns a boolean value
based on the check operation performed. On the other hand, the as operator returns null if the two
types or classes are not compatible with each other.
Most underrated UA-camr i have ever seen.
Great video, quick and to the point.
More specific ans would be
Is = returns a "bool" on checking the type
As = like a cast , converts a type
Really helpful! Thank you very much man.
Thanks so much.
impacted video
thanks a lot
IS vs AS keyword of C# explained ( C# interview question with answers)
Thanks to www.questpond.com to create this video
Good explanation. Thank you.
When i write object [] arrdata = dict["data"] as object []; It returns me null.. But it returned values in some other code I've written.. Don't know the reason.
What is real use of is and as operator. Here we already know str1 is of string type then what is use to check it?
can you Explain :
ClassA{
}
ClassB{
public static void Main(String args[])
{
ClassA objA=new ClassA();
ClassB objB=objA as ClassB;
}
}
is it run successfully or throw compile error and why ? Error? Or will it copy all references in object ClassB?
So probably it is better to use 'as' and then check the result for null.
If we use 'is', first we check if the value is a string (try to cast to string) and when if the result will be true, we need to cast it once more to string.
var result = value as string;
if (result !=null){ .... }
if(value is string)
{
var result = (string)value;
}
genius
so what's a difrent between casting and keyword "as"?
i have the same question.
IS keyword only checks strings??
one interface have 10 method and in class A we want to use 5 method and another 5 method in class B how we achieve
Create 2 interface
As keyword can not type cast to not nullable datatypes.
object obj1 = 1234;
int num1 = obj1 as int; // compile time error "The as operator must be used with a reference type or nullable types"
+Khizar Javed Not only that it will not work if your as "type" is different than the type you are trying to cast to.
object x = 44;
string str = x as 'int';
hmmm.... why not convert 1234 to "1234" when using "as"?
shi sharp