IS method overriding is Duplication of Methods?

Answer Posted / amol

No. In method overriding the behaviour of overrided method
is different. The subclass override only those methods,
which has different behaviour than superclass else alawys
use all the methods of superclass, which is better than
making a lot duplication by defining another class for same
methods of superclass.

Is This Answer Correct ?    29 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why main function is static?

674


Using callable statement how can you pass out parameters, explain with example?

590


What is a generic data type?

574


What is a singleton puppy?

535


What is google full form?

536






How is string stored in java?

561


What are latest features introduced with java 8?

593


Explain some best practices you would apply while using collection in java?

569


What are the types of inner classes (non-static nested class) used in java?

566


What is use of inner class in java?

516


How do you identify independent and dependent variables?

507


What is replaceall in java?

545


Is void a data type?

540


What is the memory leak in java?

526


What are the 8 data types in java?

523