There are 2 methods in a class. Both have the same method
signature except for return types. Is this overloading or
overriding or what is it?

Answer Posted / mohamed yehiya

If both signature are same, i.e parameters
and if the method has co-variant return type
which means return type of int in one method and
return type of long in another method.
Consider safely as the method is overloaded.

if otherwise it's neither overloaded or overrided
just an another method in the class.

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the performance aspects of core java?

555


Can we extend a class with private constructor?

527


worst case complexities of Quick sort and Merge sort.

605


When should a function throw an exception?

599


Where is the find and replace?

534






Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..

1824


how to write a program for sending mails between client and server

1555


How is it possible for two string objects with identical values not to be equal under the == operator?

528


Is null an object java?

540


What is locale in java?

579


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

572


Is it possible to write a regular expression to check if string is a number?

545


What does pointer mean?

546


Is empty string in java?

544


Is null an object in java?

565