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

What purpose do the keywords final, finally, and finalize fulfill?

618


List the features of java programming language.

566


What does it mean to flush a file?

574


Explain different types of wrapper classes in java?

603


What is java volatile?

545






What class allows you to read objects directly from a stream in java programming?

516


What is space character in java?

580


Explain method overloading?

574


What will be the output of round(3.7) and ceil(3.7)?

683


What is void data type?

582


When the constructor of a class is invoked?

597


What do you mean by append?

538


What is use of arraylist in java?

586


Is 9 a prime number?

470


Mention some features of java?

544