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.