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
Can variables be used in java without initialization?
What is difference between equal and == in java?
How do you check whether the list is empty or not in java?
Is singleton class immutable?
What is void keyword?
What is consumer in java?
What happens to the Exception object after handling an exception?
Is java 1.7 the same as java 7?
Is an array a vector?
How can we create a synchronized collection from given collection?
What is difference between printf and scanf?
What is the final keyword?
What is the benefit of inner classes in java?
why Interface used?
How does remove work in java?