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

What is polymorphism in C++?
https://vz-3ad30922-ba4.b-cdn.net/22b3f0e4-e072-48b7-9ae6-3d65a6b4ad50/play_480p.mp4
Renu
0 0
5
How to register as teacher?
On the basis of his total experience and Qualification you can do it.
Shrikrishna
Which are the best books to learn C?
- Yashwant Kanetkar - E Balagurusamy
Kratika
Is C/C++ language is still important in 2019?
Of course, C language is only the heart of any processor or controller.Because of complexity in C peoples are looking to work on High-level languages like JAVA etc.
Tejas
0 0
7
How do I perform multiplication in C++?
Multiplication in C++ is as simple as using the * operator. It's a fundamental arithmetic operation, familiar to most developers even with minimal experience in the language. The basic concept involves...
Venkataramanaiah
0 0
5

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

Ask a Question

Related Lessons

Do You Know How Is Size Of Structure Defined?
Size of the structure is defined based on multiplies of bigger data type member in the structure. Example: If a structure contains integer, char, short data type, then size of the Structure will be multiples...

Programing Languages Learning Tricks
You want to learn that new language or library or framework as soon as possible, right? That’s understandable. Fortunately, there are a handful of tips that can help you to better retain all of that...

Harshal G.

0 0
0

Memory Layout of C Programs
A typical memory representation of C program consists of following sections. Text Segment: A text segment, also known as a code segment or simply as text, is one of the sections of a program in an object...

Memory Layout in C++ vis-a-vis Polymorphism and Padding bits.
I know there is no need for the knowledge of memory layout for a normal day-to-day development of C++. However, when someone goes in the bit/byte level of C++, he needs to look for such discussion. To...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

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