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


Please Help Members By Posting Answers For Below Questions

What is output buffer?

796


Can we use both this () and super () in a constructor?

783


What are the disadvantages of using inner classes?

782


What are the steps involved to create a bean?

894


Is array dynamic in java?

687


What is sleep method?

825


Why java is platform independent? Explain.

799


Which of the following classes will have more memory allocated?

794


What is high level language in computer?

760


Can we use String with switch case?

870


Can we serialize arraylist in java?

777


what do you mean by marker interface in java?

769


How do you calculate square roots?

863


What are peerless components in java programming?

781


What is regex java?

800