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
Write a program to reverse array in place?
What are synchronized blocks in java?
Can we overload the main() method?
Does variable declaration allocate memory?
How will you load a specific locale?
What type of variable is gender?
What are thread local variables?
How does indexof work?
How to do encapsulation in java?
What is mutable object and immutable object?
What do you mean by formatting?
What is an escape character in java?
What are functions in java?
What are the two types of exceptions in java? Which are the differences between them?
What is a lambda expression ? What's its use ?