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 do you understand by overloading and overriding in java?
What’s the difference between constructors and other methods?
Is singleton class immutable?
what do you mean by classloader?
Explain thread in java?
What is a concrete classes? Is Java object class is concrete class?
What are static blocks and static initalizers in java ?
Is math class static in java?
For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green White will have 1 Weight. Red and Green carry no weights. Shortest path is the path with less weight when you add up the weights in the path.
Is singleton set an interval?
Explain the different forms of polymorphism?
Where are register variables stored?
What is use of a abstract variable?
How many threads can I run java?
Does java support multiple inheritances?