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
What is the difference between quicksort & mergesort? When should they be used? What is their running time?
What is java abstraction with example?
Why static functions are used?
How does class forname work in java?
Explain some best practices you would apply while using collection in java?
How many bytes is a url?
What does sprintf mean?
What is the char data type?
What is meant by object oriented programming – oop?
How can an exception be thrown manually by a programmer?
Explain the reason behind ending a program with a system.exit(0)?
What is stringbuffer in java?
What does int argc char * argv [] mean?
Difference between object instantiation and construction ?
Define an enumeration?