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


Please Help Members By Posting Answers For Below Questions

Is set thread safe java?

510


How do you check whether the list is empty or not in java?

520


Do you need to import math in java?

569


Is arraylist an object in java?

614


Which package has light weight components?

572






When is the finalize() called?

714


Which collection is thread safe in java?

519


What are the application of stack?

511


what is synchronization? : Java thread

567


List the interfaces which extends collection interface?

546


How do you do absolute value in java?

534


What are white spaces in java?

544


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

590


What does the exclamation mark mean in java?

605


What is slash r?

548