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
Explain wait() method of object class ?
What is the difference between hashmap and hashtable? What is an interface?
Explain differences between collection api and stream api?
Can we extend singleton class in java?
What is arguments in java?
What is the difference between stringbuffer and stringbuilder?
Can we execute a program without main?
What is anagram word?
can I implement my own start() method? : Java thread
Explain about the performance aspects of core java?
What is difference between iterator and enumeration in java?
What is multi level inheritance in java?
What is the size of a string in java?
Why is String immutable?
What is the size of arraylist in java?