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. Multiple Inheritance

Multiple Inheritance

Scheduled Pinned Locked Moved C#
csharpasp-netoopquestion
6 Posts 4 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.
  • P Offline
    P Offline
    panalprasad
    wrote on last edited by
    #1

    if any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal

    V M 2 Replies Last reply
    0
    • P panalprasad

      if any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      It's against the idea of OO programming. Coulda, woulda, shoulda doesn't matter if you don't.

      P 1 Reply Last reply
      0
      • V V 0

        It's against the idea of OO programming. Coulda, woulda, shoulda doesn't matter if you don't.

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

        But C++ is doing it all well panal

        I V 2 Replies Last reply
        0
        • P panalprasad

          But C++ is doing it all well panal

          I Offline
          I Offline
          imsathy
          wrote on last edited by
          #4

          consider a situation where classA which has a function f() classB and classC are childs of classA. hence they both have the same copy of f(). now consider classD inherits both classB and classC (multiple inheritance) in which case there will be a ambiguity as to which copy of f() is called since both of them have the same. inorder to avoid this complexity c# provides a multiple inheritance of interfaces and not classes since u give the definitions of the functions in the class which implements them sathy

          1 Reply Last reply
          0
          • P panalprasad

            But C++ is doing it all well panal

            V Offline
            V Offline
            V 0
            wrote on last edited by
            #5

            Well, there aren't that many languages that support complete OO design. Even Java and C# aren't completely OO although they're called OO languages, as is C++. C# is just more OO then C++. Maybe it's clearer in other words: In C++ we have more ways for no OO design. (eg. multiple inheritance, ...) Coulda, woulda, shoulda doesn't matter if you don't.

            1 Reply Last reply
            0
            • P panalprasad

              if any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal

              M Offline
              M Offline
              mav northwind
              wrote on last edited by
              #6

              In addition to the replies you already got, the clean way is supported by C#: your class can implement several interfaces. Regards, mav -- Black holes are the places where god divided by 0...

              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