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

i am a student of 11th class and i want to make my future in C++ is this possible i am take arts inn 11th class
Definitely.. but you should be flexible moving to java/ other languages as well.. requirement/ demand keep changing in software. i can do the needful.. with 18+ yrs exp in working on live projects...
Rajneesh
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
please tell me the best book for c programming language
LET US C by Yashwant Kanetkar. This book is very useful to improve the practical Knowledge. For Theory - Programming in C by Balagurusamy
Sunil
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

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

Ask a Question

Related Lessons

Set 0 To Kth Bit In A Variable
The following code snippet Set 0 to Kth Bit in an variable #include int UnsetBitValue(int n, int k);int main(){ printf("%d\n\n",UnsetBitValue(255,6)); return 0;}// Set kth bit to zeroint UnsetBitValue(int...

Lets learn why OOPS is popular?
1. Supports reusability- It means that once a class is designed it works just like a template which can be inherited. 2. Provides better management- It means that abstract classes and interfaces guide...
R

Why Indexing Should Start From Zero In Array ?
Why numbering should start at zero? To denote the subsequence of natural numbers 2, 3, ..., 12 without the pernicious three dots, fourconventions are open to usa) 2 ≤ i < 13b) 1 < i ≤ 12c)...

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

Swapping Two Numbers
Q. Swap two numbers using the following function. Complete the function. You won't be allowed to use a temporary variable to swap the two numbers. void swap ( ... ) { /* Swap code goes here */ } ...

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