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
Give an example of call be reference significance.
Is special character in java?
Can a abstract class be defined without any abstract methods?
What is a parameter example?
In java how do we copy objects?
What do you understand by access specifiers in Java?
What is the maximum size of a string in java?
What are exception handling keywords in java?
how we can make a read-only class in java?
What is a map in java?
What is incompatible types in java?
What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?
Can you add null to a list java?
Write a program to reverse a number in java?
What is the console in java?