Abstract Class vs Interface (Real Application Use) in C# .NET

Поділитися
Вставка
  • Опубліковано 6 бер 2023
  • Q. What is the difference between an Abstract class and an Interface (atleast 4)?
    Q. When to use Interface and when Abstract class in real applications?
    1. Full .NET Interview Course (with PDF Book)
    C# / ASP.NET Core / MVC / API - Top 500 Interview Questions
    www.udemy.com/course/csharp-o...
    Don't worry if course not helping you, Udemy has 30 days Free Refund Policy.
    2. Quick Revision Book (PDF format)
    Top 500 .NET Interview Questions - OOPS/ C#/ ASP.Net/ MVC/ SQL /.Net Core /Web API
    imojo.in/interviewhappy
    50% Discount Applied on above link.
    Don't worry if book not helping you, I will return 100% of your money with in 7 days of purchase. Just mail me at anuragrawat123@gmail.com.
    My best wishes are with you.

КОМЕНТАРІ • 42

  • @marquismccann4068
    @marquismccann4068 Рік тому +16

    This is the one abstract class video that actually makes sense to me thank you

  • @zeenatfirdoshquadri1699
    @zeenatfirdoshquadri1699 Рік тому +9

    months of confusion minutes of solution... thanku
    its very lucid

    • @interviewhappy
      @interviewhappy  Рік тому +1

      welcome Zeenat. All the best for your career.

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

    Excellent 👌
    After watching lots of difference, now I get clear idea 💡 about it...
    Thank you 👍

  • @mounikanimma189
    @mounikanimma189 Рік тому +1

    Super anna... excellent keep going do all videos anna we will support you

  • @paulh1720
    @paulh1720 Рік тому +2

    thank you for excellent content - exactly what people needed here

  • @divyapriya4324
    @divyapriya4324 7 місяців тому +2

    Abstract class :
    It is declared as abstract keyword.
    It has both abstract and not abstract method.
    It has both declaration and definition.
    Default scope of member is private.
    Multiple inherence is not supported.
    It can have constructor
    Interface:
    It is declared as interface keyword.
    It has only abstract method.
    It has only declaration.
    Default scope of member is public
    It supports Multiple inherence.
    It does not have constructor.

  • @user-ky3yh5tp5v
    @user-ky3yh5tp5v Місяць тому

    very nice explanation, Thanks to you !!

  • @DrEgypt-he4sw
    @DrEgypt-he4sw 3 місяці тому

    "Thank you for the video and all your hard work! I noticed at 6:01 you said, 'Normally we prefer Interfaces because it gives us the flexibility to modify the behavior at a later stage.' I think you might have meant to say abstract classes. Although interfaces can be changed later, there's a problem because every time you add a new method to the interface, all the classes that use this interface have to be updated to include this new method. That can cause a lot of extra work.

  • @naveenbaghel5327
    @naveenbaghel5327 Рік тому +3

    I have no word for your knowledge, awesome happy rawat ji

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

    Exactly what for I was looking 👍 thanks

  • @superkfc5410
    @superkfc5410 6 місяців тому

    Great video! Thank you for the splendid explanation!

  • @srikant67
    @srikant67 11 місяців тому

    Awesome stuff

  • @PraveenKumar-um2tx
    @PraveenKumar-um2tx 9 місяців тому

    Sir First point clear nhi huva.. Ki new feature m hum method body interface and abstract class m use kar sakte h.. Phir ye man ley ki new feature k ane pr first difference jo aap ne btya h vo exclude hai?

  • @kumaravelg2348
    @kumaravelg2348 5 місяців тому

    Use of inheritance is reuse code but when we use interface for multiple inheritance we need to write method body in each derived class. Pls clarify my doubt

  • @nityanandbhangale2409
    @nityanandbhangale2409 Місяць тому

    Sir please video in hindi on why we need to create abstract class TCS interview question.

  • @iliashterev38
    @iliashterev38 8 місяців тому

    Hello and Thank you for this tutorial.
    I think methods in interface can not have accessors, like public, etc.

  • @faizanansari7584
    @faizanansari7584 Рік тому +1

    Why have you hidden 19 videos?

  • @shubhamshinde6818
    @shubhamshinde6818 3 місяці тому

    4 year full stack .net developer ko kitna package hona chahiye

  • @grijanantony6248
    @grijanantony6248 9 місяців тому

    amazing bro keep rocking

  • @amanshukla6500
    @amanshukla6500 11 місяців тому

    but the interface now can have constructor

  • @026maheshkumars7
    @026maheshkumars7 8 місяців тому

    Thankyou so much

  • @prasadpatil9997
    @prasadpatil9997 6 місяців тому

    Thank you for clear my query

  • @armaankhan6624
    @armaankhan6624 Рік тому +6

    exactly what people look for 👍🏼

    • @interviewhappy
      @interviewhappy  Рік тому +1

      Thanks Armaan. May your achiever all your career "armans".

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

    Thank you so much 🙏🏽🙏🏽🎉🎉

  • @aritrachakraborty6658
    @aritrachakraborty6658 22 дні тому

    Abstract class can contain class fields but interface cannot contain class fields

  • @Gauravkumar-jm4ve
    @Gauravkumar-jm4ve 10 місяців тому +1

    very good

    • @interviewhappy
      @interviewhappy  10 місяців тому

      Thanks Gaurav and all the best for your career

  • @VirendraKumar-dg5qh
    @VirendraKumar-dg5qh 5 місяців тому

    if abstract class contain constructor but abstract class can not be initiated. then use this constructor?

    • @PalashBansal
      @PalashBansal 5 місяців тому

      derived class instantiation calls it first before calling derived's own constructor. Opposite sequence for destructor.

  • @Funfun96_2
    @Funfun96_2 5 місяців тому

    Thank you

  • @atulkrjha
    @atulkrjha 11 місяців тому +1

    But in your example you use public access modifier in interfaces. I think we cannot use public access modifiers in interfaces.

    • @interviewhappy
      @interviewhappy  11 місяців тому

      yes you can like this, public interface IExampleInterface

  • @cormackeenan8175
    @cormackeenan8175 Рік тому +2

    Thank you for your video, I found it very clear in explanation, but without wishing to be rude, your pronunciation of “methods” sounds like “matters” and I had to turn on captions to understand what you were saying 🤷‍♂️

    • @interviewhappy
      @interviewhappy  Рік тому +1

      @Cormac, well noted, will try to be more clear with the sound :)