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

КОМЕНТАРІ • 26

  • @questpondvideos
    @questpondvideos  3 роки тому +1

    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

  • @AlbrechtJ
    @AlbrechtJ 2 роки тому +1

    This channel is one of the best C# teacher. Very clear explanation.

  • @Game-vi6if
    @Game-vi6if 5 років тому +8

    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.

  • @harikrishnanr4794
    @harikrishnanr4794 3 роки тому +1

    Most underrated UA-camr i have ever seen.

  • @Bmaster3234
    @Bmaster3234 5 років тому +2

    Great video, quick and to the point.

  • @GumbieUsaGames
    @GumbieUsaGames 2 роки тому +1

    More specific ans would be
    Is = returns a "bool" on checking the type
    As = like a cast , converts a type

  • @jackbennett6164
    @jackbennett6164 4 роки тому +1

    Really helpful! Thank you very much man.

  • @musabalriani550
    @musabalriani550 5 років тому

    Thanks so much.

  • @pratiksingh896
    @pratiksingh896 5 років тому

    impacted video

  • @sivarajnagarajan9410
    @sivarajnagarajan9410 3 роки тому

    thanks a lot

  • @questpondvideos
    @questpondvideos  10 років тому +1

    IS vs AS keyword of C# explained ( C# interview question with answers)
    Thanks to www.questpond.com to create this video

  • @tksvel1
    @tksvel1 4 роки тому

    Good explanation. Thank you.

  • @bhargavstumpy9674
    @bhargavstumpy9674 5 років тому

    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.

  • @kirandeepsingh9144
    @kirandeepsingh9144 3 роки тому

    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?

  • @TheSachin12300
    @TheSachin12300 6 років тому +2

    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?

  • @iuriikryvenko3775
    @iuriikryvenko3775 2 роки тому

    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;
    }

  • @Thallnor93
    @Thallnor93 6 років тому +5

    so what's a difrent between casting and keyword "as"?

    • @Layarion
      @Layarion 5 років тому +1

      i have the same question.

  • @jashneaaftabi
    @jashneaaftabi Рік тому

    IS keyword only checks strings??

  • @gkmishra2009
    @gkmishra2009 4 роки тому +2

    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

  • @khizar511
    @khizar511 8 років тому +3

    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"

    • @FirstLast-ws7zw
      @FirstLast-ws7zw 8 років тому

      +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';

  • @Tall-Cool-Drink
    @Tall-Cool-Drink 2 роки тому

    hmmm.... why not convert 1234 to "1234" when using "as"?

  • @ek6065
    @ek6065 3 роки тому

    shi sharp