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
Explain the difference between extends thread vs implements runnable in java?
Can a method be static?
What carriage return means?
Can we compare two strings in java?
When should I use stringbuffer?
what is the significance of listiterator in java?
How do you sort objects in java?
What is the use of isempty in java?
How do constructors use this() and super()?
What is the difference between a factory and abstract factory pattern?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?
What is unicode in java?
What is array in java?
What is the difference between a local variable and an instance variable?
Explain the meaning of java applet.