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



Can we have a function Overloading with same number of arguments but with different return types o..

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

Can we have a function Overloading with same number of arguments but with different return types o..

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

Can we have a function Overloading with same number of arguments but with different return types o..

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

Can we have a function Overloading with same number of arguments but with different return types o..

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

Can we have a function Overloading with same number of arguments but with different return types o..

Answer / vivek

Generally no but.......... ADA(Language) supports it
..............Source Wikipedia search for polymorph ism

Is This Answer Correct ?    2 Yes 0 No

Can we have a function Overloading with same number of arguments but with different return types o..

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

Can we have a function Overloading with same number of arguments but with different return types o..

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

Can we have a function Overloading with same number of arguments but with different return types o..

Answer / ajay

Yes

Is This Answer Correct ?    4 Yes 9 No

Post New Answer

More Databases AllOther Interview Questions

5. Explain about relational algebra.

0 Answers  


Explain inner and outer joins with examples.

0 Answers   Agilent,


What is the purpose of TNS?

0 Answers   Tech Mahindra,


What is the role of driver manager?

0 Answers  


HOW WE PASS PARM PARAMETERS TO CL VARIABLES FROM RPGLE?

0 Answers  






Is data lake a database?

0 Answers  


Is it possible to update AS400 database record while reading it with no lock

1 Answers  


Define the following terms i. Inverted List ii. Candidate Key iii. B-Tree iv. Foreign Key

1 Answers   Ignou,


What is the difference between primary and candidate key?

0 Answers   BirlaSoft,


What is ole db in ssis?

0 Answers  


How to do performance tunning a database in DB2 V8.2 UDB in linux

0 Answers  


How default key is different from primary key?

0 Answers   Abacus,


Categories