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
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What is JFC?
How do you do math powers in java?
What are the object and class classes used for?
Why java is a platform independent? Explain
What is the difference between delete and delete[]
Can we use synchronized block for primitives?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
Can private class be inherited in java?
What is the applet security manager, and what does it provide?
Can java inner class be static?
What is member in java?
Is empty in java?
What are the types of web technologies?
What is matcher in java?