UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

what is method over-riding and how it is used ? if possible send with code with output or screen photo ?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Programing Hub/Trainer

Method over-riding : it is a technique in which more then one function with same name and same signature( similar type parameter) can present in program. in overriding a subclass method overrides the definition of base class method code and output mentioned in screenshot
Comments

Creative Magician

first i will explain in a easy way about the overridding to change the functionality of a particular method in every child class compare to the parent class for example.. you want to prepare a biryani.. in parent class(Home,House) their a simple casual method to prepare biryani but in every...
read more
first i will explain in a easy way about the overridding to change the functionality of a particular method in every child class compare to the parent class for example.. you want to prepare a biryani.. in parent class(Home,House) their a simple casual method to prepare biryani but in every child class(different restaurants) means in every restaurant they follow their own methodology compare to home recipe means parent class.. code in java for method overridig.. public class BiryaniH { public void prepare() { System.out.println("biryani is ready"); } } public class RestaurantOne extends BiryaniH { public void prepare() { System.out.println("biryani is ready at R1"); } } public class RestaurantTwo extends BiryaniH { void public void prepare() { System.out.println("biryani is ready at R2"); } } public class TestBiryni { public static void main(String args[]) { RestaurantOne obj1 = new RestaurantOne(); obj1.prepare(); RestaurantTwo obj2 = new RestaurantTwo(); obj2.prepare(); } } read less
Comments

Expert Technical Trainer with 15 years of work experience

You can try Virtual functions
Comments

10 years of Experience in C, C++, Device Driver, Boot Code, Embedded Systems, RTOS. Motivational Speaker and Project Manager

This allows same function name to be made to behave according to child class or sub class needs. Virtual functions are best example for this.
Comments

C++, Data Structures, Software Engineering working professional.

Dear Sayyad, Never understand the classes in terms of Child and Parent, Consider them as extensions, like for example, Suppose you have a basic class (which provides some functionality via methods), which everybody is free to use, now imagine if somebody wants to provide own version of one of the...
read more
Dear Sayyad, Never understand the classes in terms of Child and Parent, Consider them as extensions, like for example, Suppose you have a basic class (which provides some functionality via methods), which everybody is free to use, now imagine if somebody wants to provide own version of one of the methods, what are the options available. #1 Change the method in base class, which u have implemented. (Bad idea, because it will break the existing code). #2 Don't touch the class, which is in use and working, Derive a new class, and provide a new definition to the method, which u want to do differently. (Good idea, it'll not break anything), A real world example would be ... class Account { public : bool Deposit(Double amount); } class SavingAccount : public Account { public : bool Deposit(Double amount); } class CurrentAccount : public Account { public : bool Deposit(Double amount); } Do not try to copy paste and compile, this is just a pseudo-code. The explanation can continue, and we can take many more examples, where Method Overriding is used in real world. read less
Comments

View 3 more Answers

Related Questions

Explain about member functions?
Member functions are part of the class, member functions are used to access, member variable in private, protected, public area and also call another member functions.
Zeeshan
0 0
5
What is difference between object oriented procedure and object oriented programming?
i.basic building block for procedure orientation is functions while for OOPS its objects.. ii.pop follows top-down hierarchy while opps its just opposite. iii.pop lacks encapsualtion and has acesses...
Madhuranjan
Is C#, C++, Python, or JS better for game development?
All languages good for gamjng. But you can make 3d games in c# uaing unity software and it's very very interesting to work on it.
Mohit
0 0
6
Are C Programmers currently in demand?
Ofcourse, C is alwasy in demand. In the beginning a lot of the big project developed in C language. Now a days, there are a lot of language in market and speciallity is growing in IT field. For a big organization...
Harsha
Is it possible to write big safe programs in C++?
yes. C++ is generally used to write system software. For example windows operating system are writeen in C++. Most of the operating system, device driver and antivirus programs are written by using C++.
Sapna
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

C++ Program Sample Application
//Standard Library Functions(Headers Files Used in C++) #include<iostream.h> #include<conio.h> //Main function int main() { //function for clearing the screen clrscr(); //function for...

Efficient Learning Strategies
Type your notes after class Write your notes onto flashcards - Scrabble -Make posters Review flashcards while walking, at gym, etc. Dog-ear pages in the reading where you can find...

Working with C/C++ applications
Inorder to learn C and C++ programming languages one can work with various editors available.To name a few are the most popular one is turbo c++, DEV C++, Eclipse, NetBeans. Here are the screen shots...

C++ Overview
Introduction: C++ is the first object oriented programming language used universally as an advanced version of C language. Many features such as Inheritance, Class & Object, Polymorphism(Function...
N

Namrata Y.

0 0
0

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more