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
Can a class be declared as static?
How to write custom exception in java?
Explain about object oriented programming and its features?
What is static class
Explain how to force the garbage collection in java.
What do you understand by the term string pool?
What does null mean in java?
How can we make a class virtual?
What is the implementation of destroy method in java. Is it native or java code?
What is a boolean in java?
What is a consumer in java?
Why we used vector class?
Can java run on google chrome?
What are the pillars of java?
Explain the concept of proper inheritance?