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
What is overloading and overriding in java?
What are the disadvantages of using inner classes?
Why collection doesn’t extend cloneable and serializable interfaces?
Is passing by reference faster?
What is scope of a variable?
Does java arraylist maintain insertion order?
What is the purpose of extern variable?
Is java an ide?
Why we cannot override static method?
What access modifiers can be used for class ?
Write a program to show whether a graph is a tree or not using adjacency matrix.
Give example to differentiate between call by value and call by reference.
Is java code slower than native code?
What is floor in java?
Is string is a class in java?