Difference between overloading and Overriding. <Giving a
confusing example to test the concept.>
(also asked in PA Consultancy Group,iflex,Value
chain,IBM,CTS,Accenture, Tarang>

Answer Posted / priyanka patil

Function Overloading
class A
{
int show(int a,float b)
float show(int a,int b)//different prototype can valid but
as per parameters they called
}
Function overriding
class A
{
int show(int a)
};
class B : public A
{
int show(int a)//function prototype of base class fun n
derived class function must be same
}

Is This Answer Correct ?    26 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between extends thread vs implements runnable in java?

795


Can a method be static?

724


What carriage return means?

710


Can we compare two strings in java?

755


When should I use stringbuffer?

762


what is the significance of listiterator in java?

799


How do you sort objects in java?

730


What is the use of isempty in java?

751


How do constructors use this() and super()?

783


What is the difference between a factory and abstract factory pattern?

880


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

800


What is unicode in java?

707


What is array in java?

736


What is the difference between a local variable and an instance variable?

744


Explain the meaning of java applet.

821