Access Specifiers in Inheritance with Example | Public - Protected - Private | OOPs in C++

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • Support Simple Snippets by Donations -
    Google Pay UPI ID - tanmaysakpal11@okicici
    PayPal - paypal.me/tanmaysakpal11
    --------------------------------------------------------------------------------------------- In this video tutorial we will understand how inheritance works and we will see a program example which shows how inheritance can be performed in the 3 different modes that is public, protected and private.
    We will see the difference between the 3 modes of inheritance in c++
    This tutorial will give you a very clear and practical understanding of the 3 different access specifiers that work along with inheritance in c++
    Download Dev C++ IDE : sourceforge.ne....
    Download C++ Android App : play.google.co...
    Simple Snippets Official Website -
    simplesnippets...
    Simple Snippets on Facebook-
    / simplesnippets
    Simple Snippets on Instagram-
    / simplesnipp. .
    Simple Snippets Google Plus Page-
    plus.google.co...
    Simple Snippets email ID-
    simplesnippetsinfo@gmail.com
    For Classroom Coaching in Mumbai for Programming & other IT/CS Subjects Checkout UpSkill Infotech - upskill.tech/
    UpSkill is an Ed-Tech Company / Coaching Centre for Information Technology / Computer Science oriented courses and offer coacing for various Degree courses like BSc.IT, BSc.CS, BCA, MSc.IT, MSc.CS, MCA etc.
    Contact via email /call / FB /Whatsapp for more info
    email - upskillinfotech@gmail.com
    We also Provide Certification courses like -
    Android Development
    Web Development
    Java Developer Course
    .NET Developer Course

Komentáře • 75

  • @SimpleSnippets
    @SimpleSnippets  Před 5 lety +16

    Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety

      @@ksriya6807 over all the syllabus won't change much. Check my C++ tutorials playlist 🤟

    • @mrjain1430
      @mrjain1430 Před 5 lety

      @@SimpleSnippets binary file handling??

    • @carlkai9832
      @carlkai9832 Před 3 lety

      I know im asking the wrong place but does someone know of a trick to get back into an instagram account?
      I stupidly lost my password. I would love any tips you can give me!

  • @masterofdisasters4931
    @masterofdisasters4931 Před 3 lety +11

    You've taught me something in 15 min video that my lecturer could not explain clearly in a 3 hour lecture. Thank you!

  • @santoshbiradar9517
    @santoshbiradar9517 Před 4 lety +10

    I feel proud when you get wonderful feedback from people residing in other countries...Sir you doing a very great job.

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety +2

      Thank you so much Santosh. Even I am proud of you and our fellow indians who have supported this channel to make it a global channel. Please keep sharing the channel. Thats the biggest support ✌

    • @azisagantal320
      @azisagantal320 Před 4 lety +4

      @@SimpleSnippets Bro, Indians are the best when it comes to tutorials. I am from the Philippines, many students here in our country who study programming always try to find tutorials like this. Also bro, you are amazing in making tutorial videos. There is not a single video from you that I did not understand. As a gratitude, I always try to share your channel with my friends.

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety +4

      Thank you bro for such wonderful compliment ❤️ lots of love from India 😊

  • @mehak2987
    @mehak2987 Před 3 lety +4

    So underrated channel!!!!!, best explanation i can get abt programming....✌

  • @raghuhr84
    @raghuhr84 Před 3 lety +3

    All the members variable are derived into derived class according to the access specified. We can't say Private data members won't be derived because they are Private.
    1. Write a public function which prints the Private member variable.
    2. Inherit the base class into derived class with Public access.
    3. Create an object of derived class & call the print function.
    4. You can access & print the Private member variable from that print function.

  • @jamesnash9675
    @jamesnash9675 Před 2 lety +1

    you are the best.........masum

  • @anasmirza8093
    @anasmirza8093 Před 5 lety +3

    and the perfect illustration of this topic , amazing sir

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety

      Thank you so much buddy 😊 I'm glad to hear this from you ✌️

  • @dkf28
    @dkf28 Před 4 lety +2

    You are really the best programming teacher

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety +1

      Thank you so much buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

    • @dkf28
      @dkf28 Před 4 lety

      Simple Snippets I for sure will 💪🏼🔥

  • @aryankashyap4404
    @aryankashyap4404 Před 6 lety +14

    Maybe you have very less atm, but soon i think you will have trendous subscribers. Amazing videos you make

    • @SimpleSnippets
      @SimpleSnippets  Před 6 lety +1

      Hey Aryan thank you so much for such a wonderful and positive comment buddy. Yes hopefully we will be a big channel soon. But it's all in your hands to share the channel and videos with your friends 😋 help me share the knowledge with as many as you can. Keep up the support ✌️😇😎

  • @Rockstard4
    @Rockstard4 Před 6 lety +5

    You have done a great job...

  • @dogwoofwoof8154
    @dogwoofwoof8154 Před 6 lety +3

    It was just awesome
    the way you explain things are awesome

    • @SimpleSnippets
      @SimpleSnippets  Před 6 lety

      Hey buddy, I'm really glad to hear such a great comment from you. Glad you liked the video and find it helpful. Please share the videos with your other friends who will find it helpful to and keep sharing the knowledge 😇✌️

  • @wurmh2hm
    @wurmh2hm Před 4 lety +1

    Sir once again you proved yourself best...

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Thank you Sahil 😁 really happy to hear this from you buddy ☺️ please share the videos with your friends too ✌️

  • @shreyash8813
    @shreyash8813 Před 3 lety +1

    student ka loss hua hai. kyuki jab jab cpp search kiya , apka video 3rd number pe aya hai. first place me ana chahiye. VERY WELL explained. me mech se hu fir bhi cpp me interest jaga diya apne.

    • @SimpleSnippets
      @SimpleSnippets  Před 3 lety

      Thank you so much Shreyash. Bohot acha laga ye sunkar. Aap videos and channel ko share karogey toh youtube no 1 par layega videos ko toh ye aapke hath main hai🙂

  • @chhandchaughule3240
    @chhandchaughule3240 Před 4 lety +2

    Amazing teaching sir , just watching your videos clears the mind about so many C++ topics .
    Lovely teaching style sir , and liked that "peace" in the end 😄

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      So nice of you. Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @humairafasihahmed1754
    @humairafasihahmed1754 Před 2 lety

    This was incredibly precise and covered every detail !

  • @Jyotikumari-zu6dg
    @Jyotikumari-zu6dg Před 3 lety +1

    you are a gem

  • @Ninonakano_00
    @Ninonakano_00 Před 4 lety +1

    Thank you so much for making this C++ video !!!!!!!!

  • @gayatrikhot7572
    @gayatrikhot7572 Před 2 lety +1

    Nice explanation 👍

  • @Hydro1738
    @Hydro1738 Před 5 lety +2

    Whats going on guys?... this videos are amazing... why don´t you click "like"?... is the least thing we can do to support the creator...

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +1

      Thank you so much brother for this kind gesture. Means alot to me 😇

    • @Hydro1738
      @Hydro1738 Před 5 lety

      @@SimpleSnippets Hi, your work is great!!, ... just one comment... I'm following you videos and talking about this one, a realized that:
      A "private" variable of a parent class is still present in the child class (public,protected or private inherited), but such private variable can´t be seen by a child class by means of not-inherited functions or by overritten functions. If you try to access a parent-private-variable by means of an inherited function you can acces the "private variable", ... is still there, and you can read it and modify it by any inherited member function.

  • @amutha6579
    @amutha6579 Před 4 lety +1

    beautiful teaching sir.thank you so much.

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Most welcome Amutha 😊 glad to hear such a lovely feedback from you ✌️

  • @SMmmm-t9j
    @SMmmm-t9j Před 23 dny

    After the access specifier become protected in derived class How can I access the protected data members from the derived class??

  • @vinamrajha1571
    @vinamrajha1571 Před rokem

    thanks brother

  • @cookwithflame7544
    @cookwithflame7544 Před 2 lety

    It's really helpful.

  • @ReddiSathvik
    @ReddiSathvik Před 3 lety +1

    Aww, thank you so much man

  • @Asdf-wm4ow
    @Asdf-wm4ow Před 4 lety +1

    Very helpful!!!

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Thanks buddy, please do subscribe to our channel & share it with your friends too buddy. Thats the biggest help & support 😇

  • @ar3568row
    @ar3568row Před 4 lety +1

    why do you always use int main() , i tried to use void main() in code blocks , it gave me an error "main function must return an integer value" , even though my main() wasn't supposed to return anything , i should have been easily allowed to use void.
    what is wrong ? please help . :(

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Good question, here is a stackoverflow thread on this same question which will clear your doubt - stackoverflow.com/questions/449851/why-do-we-need-to-use-int-main-and-not-void-main-in-c

    • @ar3568row
      @ar3568row Před 4 lety

      Thanks , Got it , grateful to your contents 👌

  • @purnimakshirsagar6768
    @purnimakshirsagar6768 Před 6 lety +2

    Well explained :-)

    • @SimpleSnippets
      @SimpleSnippets  Před 6 lety +2

      +Bhävîkä Kśhïršãgãŕ hello, thank you so much ✌️ do share the video with your friends and contacts and keep spreading the knowledge 😇

    • @purnimakshirsagar6768
      @purnimakshirsagar6768 Před 6 lety

      Yep

  • @gurjotsingh5924
    @gurjotsingh5924 Před 4 lety +1

    is constructor of base class come into the derived class?

  • @nashhash4625
    @nashhash4625 Před 6 lety +1

    Awesome

  • @neerajmahapatra5239
    @neerajmahapatra5239 Před 5 lety +2

    You are great but why there are no ads on your videos 😢😢😢
    Other tutorial videos have lot of ads on thier videos😢😢

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +2

      Well its good for you guys na ✌️😊

    • @neerajmahapatra5239
      @neerajmahapatra5239 Před 5 lety +1

      @@SimpleSnippets but ads will give u money sir...

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +8

      Yes yes I have ads turned on. But money isn't my primary requirement 😊
      My primary need is to spread knowledge to as many as possible ✌️

    • @RaiMuhammadArslan786
      @RaiMuhammadArslan786 Před 5 lety +1

      @@SimpleSnippets love++!!!!!!!!!

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +1

      Thanks buddy 😊

  • @rushikadlag8002
    @rushikadlag8002 Před 4 lety

    understandable language ..🤘
    Thank you

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety +1

      Glad to hear that buddy. Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @manishadas7434
    @manishadas7434 Před 5 lety

    sir,when i ran this code,values of x and y showed zero.then i used this pointer in each case in the default constructor(this->x=5 etc),then it showed x=5,y=5. why is this happening??

  • @relativity5441
    @relativity5441 Před 4 lety +1

    Please provide source code too for practice.

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety +1

      I think I do share all the code files on our official website. check this website - simplesnippets.tech/

    • @relativity5441
      @relativity5441 Před 4 lety +1

      @@SimpleSnippets Brother u did create a outstanding content. I really enjoyed ur videos. I also checked ur website. It is also good and I also found codes there. But the website arrangement is not optimised enough for beginner like me. It will be great help for me if u kindly provide direct code link to concerned video in description.
      (Regards)

  • @khan_official5489
    @khan_official5489 Před 2 lety

    its very complicated to me ....

  • @narukulaanjikumar6001
    @narukulaanjikumar6001 Před 2 lety

    Source code

  • @craftsmania2244
    @craftsmania2244 Před 2 lety

    You should clear ur screen

  • @mohamadrizwan4849
    @mohamadrizwan4849 Před 5 lety

    bhai g make programs in multifiles please

  • @mohamadrizwan4849
    @mohamadrizwan4849 Před 5 lety

    please please please