Can we have a function Overloading with same number of
arguments but with different return types of function
Answers were Sorted based on User's Feedback
Answer / anupam
No,writing no. of functions with the same name but
different argument is called as function overloading.
The arguments may be differ in nos,type etc.
The return type may or may not be same.
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / abhilash s thachil
There is a catch in the question. We can have function overloading with same number of arguments with different return types. One step ahead, we can have function overloading with same number of arguments provided the type and order of the arguments are not same irrespective of return type.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / sandeep joshi
No its not possible.
Because in function overloading the return type is not play
any role.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / vikram shinde
function signature (name mangling) is done based on function
name and no. of parameter.we can't diff. by return type
because when function call there will be ambiguty.
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / vivek
Generally no but.......... ADA(Language) supports it
..............Source Wikipedia search for polymorph ism
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / deepika galankar
no . we can have same function name with arguments differ
in number,type and different order of data types . but for
function overloading compiler ignore return type.
so we can have funfions with same no of arguments differ in
sequence of data type irrrespective of return type ..
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ajay
Yes, it is possible here are the examples
create or replace function funbool(b varchar2)
return boolean
as
begin
If b is not null then
return true;
else
return false;
end if;
end;
create or replace function funbool(b varchar2)
return number
is
begin
if b is null then
Dbms_output.put_line( 'false');
else
Dbms_output.put_line( 'true');
end if;
Return b;
end;
| Is This Answer Correct ? | 1 Yes | 4 No |
WHAT TYPE OF JOINS RETURNS INCORRECT RESULTS?
What advantages does DBMS have over traditional file systems?
Explain database partitioning. What is its importance?
How does rows store in Teradata
what is the difference between relational calculus and relational algebra ?
What is the best database software for small businesses?
What is difference between data and database?
Explain database partitioning.
What is odm database?
What is the role of tester in discovery(in Checklist)?
How to do Stored procedure testing? Who does this testing (Developer or tester)?
Which is the best graph database?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)