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.

Results 1 to 6 of 6

Thread: Dought regarding Function Overloading

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    21
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Dought regarding Function Overloading

    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


  2. #2
    Member GoodbyeWorld's Avatar
    Join Date
    Jul 2012
    Location
    Hidden command post deep within the bowels of a hidden bunker somewhere under a nondescrip building
    Posts
    161
    My Mood
    Stressed
    Thanks
    14
    Thanked 25 Times in 25 Posts

    Default Re: Dought regarding Function Overloading

    class DerivedClass: public BaseClass1, public BaseClass2
    {


    };

    C++ Inheritance

  3. The Following User Says Thank You to GoodbyeWorld For This Useful Post:

    kalaicse30@gmail.com (October 7th, 2013)

  4. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,469
    My Mood
    Mellow
    Thanks
    151
    Thanked 608 Times in 595 Posts

    Default Re: Dought regarding Function Overloading

    And why are you asking here?

  5. #4
    Junior Member
    Join Date
    Apr 2013
    Posts
    21
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Dought regarding Function Overloading

    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?

  6. #5
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: Dought regarding Function Overloading

    Hello.
    There is something called scope resolution operator in C++. It helps avoid ambiguity problems in multiple inheritance.

    Syed.

  7. The Following User Says Thank You to syedbhai For This Useful Post:

    kalaicse30@gmail.com (October 7th, 2013)

  8. #6
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,234
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: Dought regarding Function Overloading

    Thread moved from 'whats wrong with my code'. For future reference, please choose the most appropriate forum for you question.

Similar Threads

  1. Dought regarding SCJP Certification
    By kalaicse30@gmail.com in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 17th, 2013, 05:23 AM
  2. constructor overloading
    By jamesjack in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 13th, 2013, 12:12 AM
  3. Overloading a method
    By Lahoree in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 15th, 2013, 11:46 AM
  4. Overloading Method
    By Tohtekcop in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 16th, 2012, 02:28 PM
  5. Overloading vs Overriding
    By nickypass in forum Java Theory & Questions
    Replies: 1
    Last Post: October 17th, 2010, 01:53 AM