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

What is the static block?

0 Answers  


What are the different collection views provided by maps?

0 Answers  


Explain different states of a thread in java?

0 Answers  


What is difference between float and double?

0 Answers  


What are the different conditional statements?

0 Answers  






How does split work in java?

0 Answers  


Can we override protected method in java?

0 Answers  


Can I uninstall java?

0 Answers  


What are the basic control structures?

0 Answers  


Explain creating threads by extending thread class ?

0 Answers  


Any one can explain how the inerface uses in java. give with example.

1 Answers   IBM,


What are the OOPS concepts in Java ?

4 Answers   Satyam,


Categories