IS method overriding is Duplication of Methods?
Answer Posted / venkat
To understand the Question, one needs to know the scenarios
where in a method is overriden.
there are two cases:
you want to override a method:
1)when the super class doesnt know how to implement it, and
leaves the implementation to the sub-class.
2)when the subclass feels, it has to add few more details
specific to itself than which are provided by the
superclass.
so there is no duplication happening provided one overrides
a method sensibly(understanding thorougly if overriding a
method is necessary or not).if one wishes to write things
that are already available, it is then called "duplication
of code",
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
How many digits is int32?
What is lossy conversion in java?
What are aggregate functions explain with examples?
What is a map in java?
What is the difference between && and & in java?
What is the exact difference in between Unicast and Multicast object?
Can I use % with real numbers?
What is the order of arraylist in java?
Is a boolean variable?
Is there any way to find whether software installed in the
system is registered by just providing the .exe file?
I have tried the following code but its just displaying the
directory structure in the registry.
Here the code :
package com.msi.intaller;
import java.util.Iterator;
import ca.beq.util.win32.registry.RegistryKey;
import ca.beq.util.win32.registry.RootKey;
public class RegistryFinder {
public static void main(String... args) throws Exception
{
RegistryKey.initialize(RegistryFinder.class.getResource("jRe
gistryKey.dll").getFile());
RegistryKey key = new RegistryKey(RootKey.HKLM,
"Software\\ODBC");
for (Iterator
Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?
How can you read an integer value from the keyword when the application is runtime in java? example?
Is it necessary that each try block must be followed by a catch block?
What is difference between hashset and hashmap?
How do you convert boolean to boolean?