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
How many decimal places is a double?
What class allows you to read objects directly from a stream in java programming?
describe method overloading
What does exp mean in math?
What are java methods?
What is a layout manager and what are different types of layout managers available in java awt?
Program to Find the second largest element in an array.
What is data string?
What is the range of the short type?
What is the difference between the paint() and repaint() methods?
What is difference between path and classpath in java?
How can we find the actual size of an object on the heap?
What are the changes in java.io in java 8 ?
How garbage collection is done in java?
Does java vector allow null?