Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 996669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:54:52+00:00 2026-05-16T06:54:52+00:00

Guys before you start down voting me please read this question and please understand

  • 0

Guys before you start down voting me please read this question and please understand that I do not try to start anything unpleasant here.

The only reason for this question is that I’m becoming more and more aware of that in order to be more employable I have to know either Java and/or C#.

Ok here is the question:

I know that multiple inheritance is forbidden in J and C#. But if I do something like this (because I would like to have a class which inherits from two classes B and A):

//code in Java
public class B
{
    public void methodFromB()
    {
    }
}

public class A extends B
{
    public void  methodFromA()
    {
    }
}

public class C extends A
{
    public void methodFromC()
    {
    }
}

So in fact as far as I understand this, I do inherit from both of them (A and B and yes I do understand that formal explanation for this is that the object A is a specialized B but none the less if I want to do it I will but it just doesn’t look pretty)

But instead of doing this in one declaration I have to first create one class inherit from another class and then derive from it?

Funny thing though. Having declared those classes as above (in NetBeans) I see that after creating an instance of class C (in main) I cannot invoke methodFromC on it which is the method defined in this class.

What is the reason for that?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:54:53+00:00Added an answer on May 16, 2026 at 6:54 am

    Your definition of multiple inheritance is not correct.

    At the OO level, multiple inheritance is well and clearly defined.

    And both C++ and Java support multiple inheritance.

    The problem is that most programmers have absolutely zero OO/OOA/OOD notions and all they know are OOP implementation details. Hence their wrong belief that “inheritance” is synonym to “implementation inheritance”.

    However this is completely wrong.

    Because Java support multiple (interface) inheritance, which happens to be the real and only form of inheritance that exists at the Object-Oriented-Analysis / Object-Oriented-Design level.

    Show me any OOD resulting from an OOA and that is using multiple inheritance and I can translate it cleanly to OOP in Java using multiple interface inheritance (as an added bonus in Java the “diamond” problem doesn’t exist).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me start off by clarifying that(before you guys dismiss me), this is not
Okay, before you guys go nuts -- this is just a small site, temporary
Hey guys I have an admin page that checks if you are admin before
OK, so before we start let me state that I have been googling and
Hai guys, Where should i start before using F#? What are the Learning curves
please guys, before I download eclipse, is it possible to use it to compile
Before you guys ask, yes I've searched online for the answer, but everything I
guys. I have a strange problem. I try to write unit-tests to web-app. I
Guys, I've came across this problem I can't resolve myselg, I'm pretty sure I
Just want to start out by saying this seems like a great site, hope

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.