Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Method Overriding and Method Overloading Differnce with simple example

Method Overriding and Method Overloading Differnce with simple example

Scheduled Pinned Locked Moved C#
csharpquestionooptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rameez Raja
    wrote on last edited by
    #1

    Hi, What is differnece between Method Overlaoding and Method overriding in C#.net .Is that true overriding only allows in Inheritance ? Best Regards Rameez

    A P 2 Replies Last reply
    0
    • R Rameez Raja

      Hi, What is differnece between Method Overlaoding and Method overriding in C#.net .Is that true overriding only allows in Inheritance ? Best Regards Rameez

      A Offline
      A Offline
      adatapost
      wrote on last edited by
      #2

      Method Overloading

      It is possible to define the same function twice while using different parameters for each definition.
      A same named function is defined more than once in your program resulting an overloading of function.

      Method Overriding

      A class may override an inherited virtual method by declaring a method with the same name and signature, and marking the declaration with the override modifier.

      override modifier replaces the inherited implementation of the method.

      A DATAPOST COMPUTER CENTRE (K.V Prajapati)

      1 Reply Last reply
      0
      • R Rameez Raja

        Hi, What is differnece between Method Overlaoding and Method overriding in C#.net .Is that true overriding only allows in Inheritance ? Best Regards Rameez

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Any beginners' book will explain that.

        R 1 Reply Last reply
        0
        • P PIEBALDconsult

          Any beginners' book will explain that.

          R Offline
          R Offline
          Rameez Raja
          wrote on last edited by
          #4

          Thanks for reply , One more question Method overriding only possible in Inheritance or we can also use it in Polymorphisim ? Best Regards

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups