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 the public, private, final, protected, and default modifiers?
Why do we need data structure in java?
What is array sorting in java?
What does jenkins do?
What is null object in java?
Can the garbage collection be forced by any means?
What is the purpose of skeleton and stub?
How to Sort Strings which are given in List and display in ascending order without using java api.
Why java applets are more useful for intranets as compared to internet?
What is the full name of java?
Can inner class have constructor?
What causes memory leak in java?
What technique is carried out to find out if a particular string is empty?
What is object cloning in Java?
What happens if I remove static from main method?