What is Co-Variant return type in method overriding?
Answer Posted / 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 View All Answers
why Java does not support multiple inheritances?
Is java developer a good career?
How do you input a string in java?
Can we increase size of array?
How listener identify that the event came from a particular object?
What will happen if a thrown exception is not handled?
What is the difference between overriding & overloading?
How do you sort a string in alphabetical order in java?
What's the purpose of using break in each case of switch statement?
What is java and why do we need it? Explain
Is there any limitation of using inheritance?
What is array class in java?
What is the difference between serializable and externalizable interfaces?
what are the high-level thread states? : Java thread
What is the difference between state-based unit testing and interaction-based unit testing?