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

How many types of memory areas are allocated by JVM in java?

824


How do you check if a number is a perfect square?

772


Can we start a thread twice in java?

735


How to reverse string in java?

894


Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification

1654


How does multithreading take place on a computer with a single cpu?

800


What is the epoch date?

757


Can a class declared as private be accessed outside it’s package?

788


How we can generate random numbers in java?

902


What do bitwise operators do?

760


What is difference between this and super keyword?

783


What do you understand by java virtual machine?

951


Write a program to print 15 random numbers using foreach of java 8?

763


What are the two ways to create a thread?

773


Are private methods final?

688