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 heap sort?
Do loops java?
What are different types of states exist for a thread?
How do you override a variable in java?
What are kinds of processors?
when a request is generated from apache tomcat 5.5 and goes to oracle 10g or mysql,,, how the oracle or mysql reads the request as apache is a web server and oracle 10g is application server? when the oracle 10g provides response, how the apche tomcat reads it???
Can we overload final method in java?
What is a java developer salary?
What do u mean by variable?
Is an array a vector?
What is the most important feature of java? What is an interface?
What is the difference between && and & in java?
What are the advantages of java?
What is default size of arraylist in java?
Why set is used in java?