OOP in C++ : How Public, Private & Protected Keyword impacts Inheritance

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น • 127

  • @Cognitive-Programmer
    @Cognitive-Programmer  3 ปีที่แล้ว

    👉 Follow my Learnings and Journey beyond software development in my other TH-cam channel 🎦 @ bit.ly/CruisingDAKSH

  • @daviddu424
    @daviddu424 ปีที่แล้ว +12

    I am a student from NYU. Your 6-minute video is much more clear than my professor's 75-minute lecture. Thanks so much!

    • @Cognitive-Programmer
      @Cognitive-Programmer  ปีที่แล้ว +1

      Thank you so much for your kind words.. Really appreciate it 🙏

  • @ced_ak
    @ced_ak 4 ปีที่แล้ว +57

    By far the best explanation about C++ classes I've seen

  • @csmeby
    @csmeby หลายเดือนก่อน +1

    final exam in 12 hours and I mayyyy have been skipping lectures but this totally saved me. Great video, made it so simple

  • @survivalizeed
    @survivalizeed 4 ปีที่แล้ว +15

    This was by far the best tutorial i have seen! You talked about any kind of case so that i dont need to ask something. Thank you very much!

  • @BelegaerTheGreat
    @BelegaerTheGreat 9 หลายเดือนก่อน +2

    This is EXACTLY what I needed! Love!

  • @MirceaBene
    @MirceaBene 3 ปีที่แล้ว +7

    Best explanation of inheritence i've seen so far! Thank you!

  • @Iitfury
    @Iitfury 2 ปีที่แล้ว +2

    best explanation on the whole youtube

  • @Abubakar-id4cx
    @Abubakar-id4cx 3 ปีที่แล้ว +1

    Thnaks sir, literally i have cleared my protected concept in just 5 minutes through parallel practice on my compiler from your video.

  • @boi_grandartem9078
    @boi_grandartem9078 ปีที่แล้ว

    u are the best Indian programmer

  • @sakshamdogra
    @sakshamdogra 2 ปีที่แล้ว

    You explain so nicely prof, I really like your humble way of speaking.

  • @sangamdalal
    @sangamdalal 4 ปีที่แล้ว +3

    Really best ever explanation of these three confusing terms. Gonna share it AMAP👍

  • @laurenlin2
    @laurenlin2 4 ปีที่แล้ว +4

    Thank you sir! Great example, really helped me understand with your amazing explanation!

  • @rezvanmohammadrezaee6121
    @rezvanmohammadrezaee6121 3 ปีที่แล้ว +1

    Thanks for the great explanation! I am sure I'll never forget it now!!

  • @brainsnackstore
    @brainsnackstore 3 ปีที่แล้ว +1

    wow your video was so simple and easy to understand i was so confused all the time

  • @mohammadwasifhossain8632
    @mohammadwasifhossain8632 3 หลายเดือนก่อน +1

    VERY GOOD EXPLANATION. THANK YOU SIR

  • @nishantkaushik8350
    @nishantkaushik8350 4 ปีที่แล้ว +2

    This property example is very understandable. Thanks 👍

  • @pratyushupadhyaya7367
    @pratyushupadhyaya7367 2 ปีที่แล้ว +1

    very nice presentation and very creative of u using the examples like father and son.

  • @jatingoyal3736
    @jatingoyal3736 3 ปีที่แล้ว +1

    Thank you so much sir ,for your best explanation of these confusing terms

    • @Cognitive-Programmer
      @Cognitive-Programmer  3 ปีที่แล้ว

      Thanks a lot for taking time out to write this comment. Thanks a lot 🙏🙏🙏

  • @danielyohannes7447
    @danielyohannes7447 ปีที่แล้ว

    Best explanation I ever seen
    Thank you so much

  • @deviltvpublication922
    @deviltvpublication922 3 ปีที่แล้ว +1

    Brilliant example, nice explanation

  • @chayondattautsha_327
    @chayondattautsha_327 2 ปีที่แล้ว +1

    Fantastic explain with nice story

  • @paakwesibless8028
    @paakwesibless8028 4 ปีที่แล้ว +1

    the explanation is clear and easy

  • @araujo_88
    @araujo_88 3 ปีที่แล้ว +1

    Very clear explanation, thanks a lot.

  • @WarriorAjk
    @WarriorAjk 4 ปีที่แล้ว +2

    Thank you so much, finally understood this!

  • @ShankarD-mf4bq
    @ShankarD-mf4bq ปีที่แล้ว

    nice explanation perfect example makes easy to understand tnx sir

  • @ТатьянаЕкельчик
    @ТатьянаЕкельчик 5 หลายเดือนก่อน

    Thanks a lot for such good and detailed explanation! ❤

  • @AtomkeySinclair
    @AtomkeySinclair 5 ปีที่แล้ว +2

    Nice example. Thank you. So, in the final code, let's say the Son class has a Daughter that also inherits - GrandDaughter class... While keeping the GrandSon class able to still have access to propValue, how do you implement the new GrandDaughter class (sibling to GrandSon) so she can NOT access propValue? So access control is, Father can access, Son can access, GrandSon can access, GrandDaughter can NOT access.

  • @sravyakilaru8573
    @sravyakilaru8573 ปีที่แล้ว +1

    superb explanation sir.

  • @hanguyenn24
    @hanguyenn24 ปีที่แล้ว +1

    Thank you! It saves my life

  • @muhammadzeeshanmoin9557
    @muhammadzeeshanmoin9557 4 ปีที่แล้ว +1

    thanks sir its very helpful for me to completing my assignment
    thanks alot

  • @ShameerMohammed
    @ShameerMohammed 3 ปีที่แล้ว +1

    Superb Example!! :)

  • @andrewdoesthings__
    @andrewdoesthings__ ปีที่แล้ว

    This was a great explanation, thanks! Quickly helped me clear up some confusion with derived class definitions😄

  • @rishabhmishra3017
    @rishabhmishra3017 2 ปีที่แล้ว

    Best video on inheritance sir🙏😊

  • @gauravv8097
    @gauravv8097 2 ปีที่แล้ว +1

    beautiful explanation

  • @Dima-Teplov
    @Dima-Teplov 2 ปีที่แล้ว +1

    Awesome explanation! :)

  • @danielkim4151
    @danielkim4151 ปีที่แล้ว +1

    Amazing video!

  • @deepaksingh9318
    @deepaksingh9318 3 ปีที่แล้ว +1

    Loved the example ..

  • @explore_Finland
    @explore_Finland 3 ปีที่แล้ว +1

    Best explanation

  • @nachikethjoshi4751
    @nachikethjoshi4751 3 ปีที่แล้ว +1

    Best example Ty sir

  • @RasGun_Travels_Life_Journey
    @RasGun_Travels_Life_Journey 5 ปีที่แล้ว +1

    good explanation sir thanku so much for ur time

  • @khantildesai929
    @khantildesai929 4 ปีที่แล้ว

    this video needs more views

  • @jawadwakeel9036
    @jawadwakeel9036 3 ปีที่แล้ว +1

    Thank you sir💗💗

  • @jonykhan4395
    @jonykhan4395 ปีที่แล้ว

    Good work: Does the private member of the Base class is sharing memory for the child object or child object just has the permission to access from the Base class?
    In the case of public and protected, Do the protected and public members of the Base class share memories for the child object?

  • @jockergaming6853
    @jockergaming6853 11 หลายเดือนก่อน

    best explanation

  • @ramankumargautam1122
    @ramankumargautam1122 7 หลายเดือนก่อน

    Great video

  • @alexanderbowers5225
    @alexanderbowers5225 2 ปีที่แล้ว +1

    Thank you very much

  • @supriya2091
    @supriya2091 3 ปีที่แล้ว

    Atlast, fatherproperty is public.Can i create object Fatherproperty in main() and access the property? so even if it is protected to son, i can create object of faterproperty class. Right?

  • @mahendrashah9810
    @mahendrashah9810 4 ปีที่แล้ว +1

    nice sirji

  • @tqaquotes9379
    @tqaquotes9379 3 ปีที่แล้ว +1

    Perfect!

  • @meerastechzone9818
    @meerastechzone9818 ปีที่แล้ว

    Very clever explntn

  • @famousforpersonal
    @famousforpersonal 7 หลายเดือนก่อน

    really awesome

  • @leeepofaith5666
    @leeepofaith5666 ปีที่แล้ว

    If i have a private value, can i access it via pointers still?

  • @youssefbezzarga4158
    @youssefbezzarga4158 3 ปีที่แล้ว +1

    thank you so much

  • @marshalinreena.c6309
    @marshalinreena.c6309 3 ปีที่แล้ว +1

    Sir super sir

  • @menachemlevi
    @menachemlevi 11 หลายเดือนก่อน

    well explain

  • @sharoozasghar4956
    @sharoozasghar4956 3 ปีที่แล้ว +1

    So private, only class can access it
    Protected only inherited classes can access it
    Public everyone can access it.

  • @rachadlakis1
    @rachadlakis1 3 ปีที่แล้ว

    Thanks

  • @sergeyshestakov4936
    @sergeyshestakov4936 ปีที่แล้ว +1

    thanks

  • @iamLPUbuddy
    @iamLPUbuddy 2 ปีที่แล้ว +1

    Tq sir

  • @sonammalik17
    @sonammalik17 3 ปีที่แล้ว +1

    👍

  • @grownupgaming
    @grownupgaming 3 ปีที่แล้ว

    GOODSHIT!

  • @tanishqsahu606
    @tanishqsahu606 2 ปีที่แล้ว

    awsum

  • @sakshamsrivastava6280
    @sakshamsrivastava6280 3 ปีที่แล้ว +1

    Just wow..

  • @a06avinashkumar
    @a06avinashkumar 2 ปีที่แล้ว +1

    🙏🙏

  • @kostadingramatikov9692
    @kostadingramatikov9692 2 ปีที่แล้ว

    Dude i still cannot understand it, no fucking body cannot access the father property if the code is written to access only the son property. What is the point if only the programmer decideds??? Unless there is something secure in memory I don't really understand what is the fucking point of using them.

    • @Cognitive-Programmer
      @Cognitive-Programmer  2 ปีที่แล้ว

      Hello
      Thanks for your comment. I have just used a metaphor to explain the concept.
      I am sorry if I couldn’t manage to explain it properly 🙏

    • @kostadingramatikov9692
      @kostadingramatikov9692 2 ปีที่แล้ว

      @@Cognitive-Programmer nah dude you explained it perfectly i know how to use them i simply don't know why we are using it, other than the fact that its makea the code more clean and structured I don't see any other point, my teachers always say its for security but i cannot understand what security the user is running the compiled code he cannot make changes, are we talking about buffer overflow or some shit i cannot understand thats why i am asking.

    • @Cognitive-Programmer
      @Cognitive-Programmer  2 ปีที่แล้ว +1

      Hello
      I believe there meaning of security means preventing someone from driving your class and changing it accidentally.
      There is no runtime security associated with our.. No buffer overflows security nothing like it.

  • @PreethikaStudios
    @PreethikaStudios 10 หลายเดือนก่อน

    The way you explained 🫶👏