Hi Frnds,
I know java does not support multiple inheritance because of diamond problem of multiple inheritance but my question is how it could be achieved in C++.Because C++ support multiple inheritance.
Regards,
Kalaiyarasi
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi Frnds,
I know java does not support multiple inheritance because of diamond problem of multiple inheritance but my question is how it could be achieved in C++.Because C++ support multiple inheritance.
Regards,
Kalaiyarasi
class DerivedClass: public BaseClass1, public BaseClass2
{
};
C++ Inheritance
kalaicse30@gmail.com (October 7th, 2013)
And why are you asking here?
Tan q for ur Replay. My question is I will create object for DerivedClass. BaseClass1 and Baseclass2 both are having same function name with same parameter list like Display().If I try to call Display function by use of Derived Class object. then C++ compiler will call which BaseClass Display().Whether BaseClass1 or BaseClass2?
Hello.
There is something called scope resolution operator in C++. It helps avoid ambiguity problems in multiple inheritance.
Syed.
kalaicse30@gmail.com (October 7th, 2013)
Thread moved from 'whats wrong with my code'. For future reference, please choose the most appropriate forum for you question.