Movatterモバイル変換


[0]ホーム

URL:


Translate:
  • Follow Us

  • Pages

  • Find a Job
  • DFP-300×250-1

  • Newsletter Subscription

      Email

      Country


    • Jobboard

    • Does C++ support multiple inheritance?

      Yes, C++ does support the use of multiple inheritance – where a class is derived frommore than one direct base class. Let’s show an actual example of multiple inheritance. Suppose we have a class D, that derives from 2 classes – B and C. This is what the code would look like in order to implement multiple inheritance in C++ (assuming we have classes B and C):

      class B { /* ... */ };class C { /* ... */ };// this is multiple inheritance:class D : public B, public C { /* ... */ };

      What problems could be caused by multiple inheritance?

      There is a problem known as the diamond problem that occurs when multiple inheritance is used in a certain way. You can read more about it here:Diamond Problem Explained

      Does Java have multiple inheritance?

      No, Java does not have multiple inheritance, but it has interfaces which can be used instead of multiple inheritance. For more information on this read here: Multiple Inheritance in Java.

      Hiring? Job Hunting? Post a JOB or your RESUME on our JOB BOARD >>

      Subscribe to our newsletter for more free interview questions.

      Follow @programmerintvw
      Previous...
      Next...

      Would you like to thankProgrammerInterview.com for being a helpful free resource?Then why not tell a friend about us, orsimply add a link to this page from your webpage using the HTML below.

      Link to this page:

      Please bookmark with social media, your votes are noticed and appreciated:


      [8]ページ先頭

      ©2009-2025 Movatter.jp