What is Co-Variant return type in method overriding?



What is Co-Variant return type in method overriding?..

Answer / harini

If the parent class method return type is object then child
class method return type need not be object. We can take
its child classes also.
The co-varient return types of no. class are
Byte/short/integer/long/float/double.
ex:
object-----string ----valid
number-----integer----valid
string------object----invalid

Is This Answer Correct ?    18 Yes 0 No

Post New Answer

More Core Java Interview Questions

Different types of modifiers?

8 Answers   RoboCom,


Can we call virtual funciton in a constructor ?

0 Answers   XX,


What about anonymous inner classes in java?

0 Answers  


How to perform bubble sort in java?

0 Answers  


What is the default value of byte datatype in java?

0 Answers  


What is the list interface?

0 Answers  


How do you convert an int to a string in java?

0 Answers  


Can static methods be inherited?

0 Answers  


What is a lightweight component?

0 Answers  


Say any two properties in beans?

0 Answers  


How will you communicate between two applets?

0 Answers  


Difference String and String Buffer

4 Answers  


Categories