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 / shamsherabanu
It is not overloading because overloading must have different parameters, no matter what ever may be the return type is.
And for overriding inheritance should be used between 2 classes.
so it is neither overriding nor overloading.
It just show compilation error as method is already defined in
same class
Is This Answer Correct ? | 12 Yes | 0 No |
Post New Answer View All Answers
What are local variables?
How do you declare an array that will hold more than 64KB of data?
How to create packages in java?
What will be the output of round(3.7) and ceil(3.7)?
What is the file extension for java?
What java ide should I use?
What is a java object and java application?
Why should I use abstract class?
What is meant by method?
Which of the classes will have more memory allocated?
What is the maximum size of array in java?
Is array size fixed in java?
Can we call a non-static method from inside a static method?
What things should be kept in mind while creating your own exceptions in java?
Can we convert list to set in java?