Function Overriding in C++ | Inheritance | OOP in C++ programming

Sdílet
Vložit
  • čas přidán 15. 01. 2018
  • Support Simple Snippets by Donations -
    Google Pay UPI ID - tanmaysakpal11@okicici
    PayPal - paypal.me/tanmaysakpal11
    --------------------------------------------------------------------------------------------- In this video we will study and understand the concept of Function Overriding and compare with with Function Overloading and how they both are different from each other.
    We will compare them theoretically and then we will also see a c++ program example of function overriding.
    Function Overloading - Function overloading is a feature in C++ where two or more functions can have the same name but different parameters.
    Function overloading can be considered as an example of polymorphism feature in C++
    Function Overriding - If derived class defines same function as defined in its base class, it is known as function overriding in C++
    If you create an object of the derived class and call the member function which exists in both classes (base and derived), the member function of the derived class is invoked and the function of the base class is ignored.
    It enables you to provide specific implementation of the function which is already provided by its base class.
    Function Overriding in C++ Theory Article - simplesnippets.tech/function-...
    Download Dev C++ IDE : sourceforge.net/projects/orwe...
    Download C++ Android App : play.google.com/store/apps/de...
    Simple Snippets Official Website -
    simplesnippets.tech/
    Simple Snippets on Facebook-
    / simplesnippets
    Simple Snippets on Instagram-
    / simplesnipp. .
    Simple Snippets Google Plus Page-
    plus.google.com/+SimpleSnippets
    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
    Check us out on Social media platforms like Facebook, Instagram, Google etc
    Facebook page - / upskillinfotech
    Insta page - / upskill_infotech
    Google Maps - goo.gl/maps/vjNtZazLzW82

Komentáře • 96

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

    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 ✌

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

      Can you do a video on some more complex examples of function overriding , by the way love your videos

    • @lorenapdolo9071
      @lorenapdolo9071 Před 2 lety

      Yes I have subscribed

  • @jayashreesampath4482
    @jayashreesampath4482 Před 3 lety

    you have no clue how helpful this is for me!!!! thank you tanmay and dont stop sharing you knowledge ever

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

    You explain it in weird way, But example is exactly what I see long time ago. Many other peoples are teaching it in wired way, and it don't have sense.
    You're example show me that essence.

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

    Finally , find a good channel to study😌

  • @hunterzone4846
    @hunterzone4846 Před 4 lety +12

    Very good explanation, first time learning this and i was able to grasp this topic instantly. Thank you for your amazing videos. 😁👍

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

      That's great to know buddy, please do Subscribe to our channel as we have a lot tech educational content which you'll surely like. Also please do share our channel and videos with your friends too, that's the biggest help and support you can provide buddy ✌

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

    great video, thank you! Answers what i was looking for!

  • @Shiviworld774
    @Shiviworld774 Před 3 lety

    Great channel...explain clearly every single topic..

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

    Wow! your explanations is so clear! Thank you

  • @mert1354
    @mert1354 Před 6 měsíci +1

    You are the king man thank you from Ghana

  • @arbabmaalik1495
    @arbabmaalik1495 Před 3 lety

    Really a good explanation, way better then our professor

  • @tsepomkwebu5577
    @tsepomkwebu5577 Před 6 měsíci

    Thanks bro. Keep up the good work

  • @ivankocevski5606
    @ivankocevski5606 Před 4 lety

    About the explanation before the coding. Can we access the function while creating object from the Base class and not the Derived class?

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

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

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

    Thank you so much bro

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

    This was really helpful

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

    DerivedClass obj = DerivedClass();
    BaseClass obj = DerivedClass();
    wats this can you explain and how it is suppose to transfer the control to the base function
    i read it somewhere else

  • @charindujayanath3612
    @charindujayanath3612 Před 3 lety

    Great shot thanks bro

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

    thankx bro overriding concept is cleared now

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Thats really great to know buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @adhityagn3278
    @adhityagn3278 Před 2 lety

    Thanks.. Good Explanation. Subscribed.

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

    your videos teach us a lot..but one suggestion is that, include why we need that this in our programme...what is the use of functin overroaling or overrindg or inheritence or anything....
    may be you can tell in day to day coding use...in your video..
    this helps you to give viewers a good grip on where to use...
    hope you would consider this ...

  • @naive-fleek7420
    @naive-fleek7420 Před 3 lety

    Thanks Tanmay

  • @hacksick
    @hacksick Před 2 lety

    thank you so much

  • @naeroforceofficial
    @naeroforceofficial Před 5 lety +4

    The example should have been the one with figures and areas, not the concept already saw on diagrams before! Just an advice, great videos! Thanks :)

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

      Thats a good suggestion. I will keep this in mind 😇 And thank you for the positive feedback buddy 😁

  • @jagratsingh937
    @jagratsingh937 Před 3 lety

    Great work 🔥🔥🔥🔥🔥🔥

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

    You are awesome sirr.....🙏🙏🙏

  • @paruldamahe7969
    @paruldamahe7969 Před 3 měsíci

    nice explanation

  • @monarch2002
    @monarch2002 Před rokem +2

    U deserve more views bro 👌 excellent explanation

    • @SimpleSnippets
      @SimpleSnippets  Před rokem +1

      Thank you bro 🙏😁

    • @monarch2002
      @monarch2002 Před rokem +1

      @@SimpleSnippets i been preparing for placements please give me inputs anything need to be prepared,I have learnt c++,Java, frontend developer,DSA now I am learning

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

    great teacher .love the way you do it..
    can you just add some more practical examples from dev cpp.

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

      Thank you so much for such lovely feedback my friend 😊 surely I'll check up on more topics.
      Also currently I'm working on data structures and the practical implementation is done in C++ only 😊✌️ so that surely will add a few more topics 😊

  • @ron3473
    @ron3473 Před 2 lety

    Method overriding/overloading is same as function overloading/overriding? right?

  • @damarlaomjayasankar2576

    sir ,
    If it is hierarical inheritance then we have to create the object for CAT only. . . . .
    but u created the objects for evry fn.

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

    what is the general meaning of scope resolution func i.e. double colon??

  • @anshikaanshika464
    @anshikaanshika464 Před 4 lety

    but then when do we use virtual functions??

  • @deepakkirtania179
    @deepakkirtania179 Před rokem

    thanks

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

    Function overriding small error semicolon while overriding getdata() in derived class

  • @musinguzimarvinjoseph9950

    did you say "shapes" or "Sheeps" thanks for the work but i didnt understand the diagrams properly
    thanks aloot

  • @ashishkushwaha1167
    @ashishkushwaha1167 Před 5 lety +4

    Awesome explaination.....plz guide me how i can improve my vocabulary

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

      Thank you so much Ashish 😇 means a lot to me.
      Well umm honestly my vocab isn't good. Speaking skills are basic like only need to know basis kind of.
      Things ideally ppl do to improve communication skills -
      1. Reading books (this is I guess the best)
      2. Talk in English with friends
      3. English movies songs etc
      Things I did -
      1. English songs
      2. English movies
      3. English TV series
      4. Sometimes speak in English with friends. That's it.
      I'm not a book reader but that's ideally what we're supposed to do 😇✌️
      Hope this helps, all the best 🙏

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

      @@SimpleSnippets thank you so much.....i appreciate you replied.......i will definitely implement these

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety

      Most welcome buddy 😇
      Happy to help ✌️

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

    Really it helps me a lot😌👍👍

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Thats really great to know buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

    • @saurabhpatil_
      @saurabhpatil_ Před 4 lety

      @@SimpleSnippets yup
      I already do it✌️😄

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

    Thanks man

    • @SimpleSnippets
      @SimpleSnippets  Před 6 lety

      You're welcome buddy. Please keep sharing these videos, that will be the best support and help you can give to our channel 😇✌

  • @note.inspace
    @note.inspace Před 4 lety +1

    Nice explanation 🔥

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      Thank you so much bro 😇 Glad to hear this from you, Please do share the videos with your friends too ✌

  • @AKSHATADIGHE
    @AKSHATADIGHE Před 2 lety

    You have given semicolon while giving a basic example for Data function in base and derived

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

    Dude I have a doubt what is the use of scope operator ,which we write after the function signature like void abc::cde(). ?

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety

      It is just another way to basically make your class code look cleaner. That is you can declare a function/method inside the class but the definition can be written outside. That makes the class look cleaner and this approach is used when there are many methods inside a class.

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

      Then void abc::i=1; is this valid ? And if how?

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety

      @@harishr9774 Check this post - www.programmingsimplified.com/cpp/source-code/scope-resolution-operator

    • @harishr9774
      @harishr9774 Před 5 lety

      No to put it clear,I looked up the static keyword definition ,which said it has “scope” till the program lifetime,I am asking what is the meaning of the “scope” here?? Thanks and sorry for pestering you !😅

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

    Good

  • @quratulainkazmi5287
    @quratulainkazmi5287 Před 4 lety

    Sir g Write a program that implement multi level,multiple level inheritance constructor overloading,function overloading,friend class,friend function,Static data member and static member function?in saari ka ek program bna da plz....

  • @quratulainkazmi5287
    @quratulainkazmi5287 Před 4 lety

    Sir g Write a program that implements multilevel inheritance,multiple inheritance, constructer overloading,function overloading,friend class,friend function,Static datamember and static member function? in sub ka aktha ek program likh den ga plz.....pora program jis ma ya sub add hon

  • @govindsisodia5530
    @govindsisodia5530 Před 5 lety

    Where are u from

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

    speaking speed is too fast== anyway this really helps me a lot! thank you!

  • @govindsisodia5530
    @govindsisodia5530 Před 5 lety +5

    Good English

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety

      Thank you so much ya. That really means a lot 😊

  • @rakeshuppar315
    @rakeshuppar315 Před 2 lety

    sir, another two example

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

    Create more example!😊

  • @janakiisajeev
    @janakiisajeev Před rokem

    😭❤️

  • @pulkitpandey2416
    @pulkitpandey2416 Před 4 lety

    Bro what are the earning options after learning c++....I have learnt c++

  • @deepakpawate7216
    @deepakpawate7216 Před 5 lety

    Function overriding to achieve why virtual function you have not used. You have missed

  • @matallidamat8910
    @matallidamat8910 Před 3 lety

    Please awaz ki spead bohat ha samaj nahi ati asa lagta ha book reading ho rahi ha

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

    Hi

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

    Good tutorial
    But stop saying there is another tutorial on this topic another tutorial on this topic another tutorial on this topic.
    Can find that as this one also .
    Irritating. plz
    thnx.

  • @kashapogusachin4379
    @kashapogusachin4379 Před 3 lety

    Can u plzz slow down ur flow of teaching.its little bit faster....

    • @leticiaakumu9920
      @leticiaakumu9920 Před 3 měsíci

      u can always pose the video and rewatch, however his content has been very helpful 😊

  • @elyrb1185
    @elyrb1185 Před 5 lety

    The fuck is this x10 speed? I cant understand shit.

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

      Figured it out, tip for everyone.
      Set the speed to 0.75, it will be clearer.

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

      Sorry for that speed 😅

  • @tushargoyal3804
    @tushargoyal3804 Před 3 lety +2

    I love your content but it annoys me the most when you talk about referring to previous tutorial every 40 sec.

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

      Sorry for that Tushar. Actually it's for people who randomly stumble across my videos and probably don't know about other videos. Very few like you know much about the channel hence gotta keep that extra 40 seconds to let everyone know 😅😁

  • @vipulsontakke7080
    @vipulsontakke7080 Před 4 lety

    Good tutorial
    But stop dropping cards.

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

      It might actually help someone. You have the choice to ignore! ✌