Is following functions are said to be overloaded?
int add(int a,int b)
char *add(int a,int b)
Answer Posted / abilask
Yes the said funtion add is overloaded.
But it is in ambiguous state because of passing element is
same.
Compiler will differ with the passing elements, but dont
consider the return value.
In this quiestion the two add funtion having two different
return type int & char * respectively.
I think the below one will be correct example for
overloaded function.
int add(int a,int b);
char *add(float a,int b);
| Is This Answer Correct ? | 8 Yes | 7 No |
Post New Answer View All Answers
What is static in oop?
What is the real life example of polymorphism?
Which is not an object oriented programming language?
What is a class in oop?
Can you explain polymorphism?
Which is better struts or spring?
What is methods in oop?
Why is there no multiple inheritance?
Can a varargs method be overloaded?
Can you inherit a private class?
Why is abstraction needed?
Explain virtual inheritance?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
How Do you Code Composition and Aggregation in C++ ?
What language is oop?