What is Co-Variant return type in method overriding?
Answer / 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 |
What does 3 dots mean in java?
What is an abstract class and what is it’s purpose?
What are the differences between graph and tree?
Can we rethrow the same exception from catch handler?
84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.
What are assertions in java?
How to perform Singleton of the java class object on multi JVM?
I want to persist data of objects for later use. What is the best approach to do so?
what are the different non-access specifiers in java?
what are the difference between Java and .Net?
Write code of any action class?
what is the difference b/w PUT and POST method to send data to the server