What is Overriding and how can it be used?

Answer Posted / pranab dutta

If a class defines a method using the same name, return
type, and arguments in its super class, then it is called
Overriding. Methods are overridden to make them more
public. The method in the class overrides the method in the
super class.
When the method is invoked for an object of the class, it
is the new definition of the method that is called, and not
the method definition from super class.

Is This Answer Correct ?    46 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we catch more than one exception in a single catch block?

619


Explain creating threads by implementing runnable class?

577


What is void keyword?

658


What are the characteristics of Final,Finally and Finalize keywords.

687


what methods would you overwrite in java.lang.object class?

556






Can a main method be declared final?

573


Is string pool garbage collected?

537


Can you explain the meaning of aggregation and composition

561


How to use string tokenizer class.

608


What is the byte order of byte buffer?

555


What is a nullable field?

567


How do you replace all in word?

514


What is the purpose of main function in java?

528


Which is better arraylist or vector?

561


Why is a string immutable?

533