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

Can variables be used in java without initialization?

842


What is difference between equal and == in java?

746


How do you check whether the list is empty or not in java?

769


Is singleton class immutable?

744


What is void keyword?

886


What is consumer in java?

742


What happens to the Exception object after handling an exception?

2113


Is java 1.7 the same as java 7?

816


Is an array a vector?

776


How can we create a synchronized collection from given collection?

877


What is difference between printf and scanf?

770


What is the final keyword?

774


What is the benefit of inner classes in java?

872


why Interface used?

765


How does remove work in java?

750