WHAT IS METHOD OVERRIDING?

Sanjay Sharma

Total Post:42

Points:210
Posted by  Sanjay Sharma
C# 
C#
 1595  View(s)
Ratings:
Rate this:
  1. Pushpendra Singh

    Post:241

    Points:1205
    What is Method Overriding?

    Method Overriding is achieved when a subclass overrides non-static methods defined in the superclass, following which the new method implementation in the subclass that is executed.
    The new method definition must have the same method signature and return type.
    Clas A
    {
    Virtual void sum (int a)
    {
    }

    }

    Class B:A
    {
    public overrid void sum (int a)
    {

    }
    }

  1. Chris S

    Post:23

    Points:115
    What is Method Overriding?

    Method overriding, in object oriented programming, is a language feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its superclasses or parent classes. The implementation in the subclass overrides (replaces) the implementation in the superclass by providing a method that has same name, same parameters or signature, and same return type as the method in the parent class.If subclass (child class) has the same method as declared in the parent class, it is known as method overriding in java.

      Modified On Mar-21-2016 06:55:43 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!