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

Is it possible to compare various strings with the help of == operator? What are the risks involved?

614


Is string is a keyword in java?

545


Can a static class implement an interface?

547


Can you give names of Container classes?

1849


What is string in java with example?

484






Explain the difference between an Interface and an Abstract class?

622


What are the new features in java 8?

565


Define jre i.e. Java runtime environment?

572


What is the multi-catch block in java?

528


Why strings in java are called as immutable?

589


Are arrays static in java?

578


What is classpath?

546


What are the advantages of inner classes?

507


What is a instance variable?

579


What is final?

601