Difference between Overloading and Overriding?

Answer Posted / janet

1. In overloading,there is a relation ship between methods
available in the same class where as in overridding,there
is relationship between a super class method and subclass
method.
2. overloading doesn't block inheritence from the
superclass where as overridding blocks inheritence.

3. in overloading,seperate methods share the same name
where as in overridding,subclass methods replaces the
superclass.

4.overloading must have different method signatures where
as overriding must have same signature.

Is This Answer Correct ?    482 Yes 79 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

2034


What is the array and initializing arrays in c++?

503


What is difference between array and vector in c++?

554


What is math h in c++?

602


how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include //INCLUDE EVERY KNOWN HEADER FILE #include //FOR ANY CASE... #include #include #include main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<

1810






Why do we use structure in c++?

570


What is the difference between public, private, and protected access?

614


Write a program in C++ for Fibonacci series

655


Why c++ does not have finally?

585


Does a derived class inherit or doesn't inherit?

616


Does c++ have arraylist?

536


Should the member functions which are made public in the base class be hidden?

556


Is map ordered c++?

592


Can we make any program in c++ without using any header file and what is the shortest program in c++.

611


What are signs of manipulation?

584