what is the purpose of method overriding in java where v r
completely re-defining a inherited method instead y can't v
create a new method and define.If the question is very silly
plz excuse me and do reply.Thank U!
Answer Posted / kv
The answer lies in Object Oriented concept. When you are
overriding a method, you overriding the internal details of
default behavior. But your interface to external world is
not changed. Example, Base class employee has a method
commuteToWork(). All the manager in the company has given
the company car and a driver. Their implementation of
commuteToWork will be different from the non manager
employees. If you add a new method saying
commuteToWorkByCar(), every Monday morning you would need to
call different method for each subtype of employee. Hope it
will help.
Is This Answer Correct ? | 13 Yes | 23 No |
Post New Answer View All Answers
How will you call an Applet using Java Script Function?
What are the main uses of this keyword?
how its run?
Explain the scope of a variable.
How to split a string in java?
We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.
What is palindrome in java?
How does queue work in java?
Explain about version control?
Is java se free?
Give an example of call be reference significance.
Can you make a constructor final in Java?
What is the purpose of java?
Can a class extend 2 classes in java?
Can a abstract class be defined without any abstract methods?